Sign in to follow this  
Followers 0
memnon

_Nowtime () in 24hour format

4 posts in this topic

Hello,

i think i have a simple question....

if i use _Nowtime () to get actual time i do not get time in 24hour format, what means, if its 14:00 i get 2:00.

can somebody help me to get it into te right format ?


das beste Windows Support Forum: Windows 2000 Helpline und tschüss den WindowsfehlernProgrammieren: Autoit 3 - wer braucht noch VBS ?!Programmieren: Autoit 3 Forum?

Share this post


Link to post
Share on other sites



Hello,

i think i have a simple question....

if i use _Nowtime () to get actual time i do not get time in 24hour format, what means, if its 14:00 i get 2:00.

can somebody help me to get it into te right format ?

<{POST_SNAPBACK}>

How about

$hour=@HOUR
$min=@MIN
$sec=@SEC
MsgBox(1, "Time is" , $hour & ":" & $min & ":" & $sec)


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

A little digging reveals that _NowTime() just evaluates the @HOUR, @MIN, @SEC, ... macros through another function in the <date.au3> include file, _DateTimeFormat(), which in turn looks up your locale settings in the registry to find out whether to display the time in 24hr or 12hr format. Obviously on your system (and mine) it decides to give you the time in 12hr format.

You can get a string for the proper time in 24hr format by just using @HOUR & ":" & @MIN & ":" & @SEC. You don't have to use the <date.au3> package at all.

hope that helps

ben

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0