cypher175 Posted December 27, 2008 Share Posted December 27, 2008 Is there any way to Force a 12-hour Time format like: 5:32:11 PM, 12:32:11 AM So whenever i need to get the time to use in a Variable or Function it will always return in the 12-hour AM-PM Time format..?? Can this be done in AutoIt at all..?? Link to comment Share on other sites More sharing options...
cypher175 Posted December 27, 2008 Author Share Posted December 27, 2008 anybody know if this is possible at all..?? Link to comment Share on other sites More sharing options...
TurionAltec Posted December 27, 2008 Share Posted December 27, 2008 doing a search for "12 hour time", I found this:http://www.autoitscript.com/forum/index.ph...hl=12+hour+timeWhich is basically rolling your own logic. I tweaked it slightly. msgbox(64,"Current time", "It is currently " & time12hr()) Func time12hr() $iHour = @HOUR $iMin = @MIN $iSec = @SEC $sAMPM = "AM" If $iHour >= 12 Then $sAMPM = "PM" If $iHour = 00 Then $iHour = 12 If $iHour > 12 Then $iHour -= 12 Return $iHour & ":" & $iMin & ":" & $iSec & " "& $sAMPM EndFunc Link to comment Share on other sites More sharing options...
BinaryBrother Posted December 27, 2008 Share Posted December 27, 2008 doing a search for "12 hour time", I found this: http://www.autoitscript.com/forum/index.ph...hl=12+hour+time Which is basically rolling your own logic. I tweaked it slightly. msgbox(64,"Current time", "It is currently " & time12hr()) Func time12hr() $iHour = @HOUR $iMin = @MIN $iSec = @SEC $sAMPM = "AM" If $iHour >= 12 Then $sAMPM = "PM" If $iHour = 00 Then $iHour = 12 If $iHour > 12 Then $iHour -= 12 Return $iHour & ":" & $iMin & ":" & $iSec & " "& $sAMPM EndFunc This should be a UDF... If a minor change like the one between StringSplit() and _StringSplit() can make one a UDF, this should deffinately be a UDF... SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now