GetTime()
Blitz3D Forums/Blitz3D Beginners Area/GetTime()
| ||
@all, When you use GetTime(), what you get in return is a 24-hour / military version of the time. Does GetTime() not support 12-hour mode AM/PM ?? Does anyone have a conversion type of code from GetTime() (24 hour) -> 12-hour ? |
| ||
What is this GetTime()? |
| ||
UUPS! Meant CurrentTime() ;-) |
| ||
Print GetTime$() Function GetTime$() time$ = CurrentTime$() hour = Left$(time$, 2) If hour > 12 hour = hour - 12 AMPM$ = " PM" Else AMPM$ = " AM" EndIf Return hour + Right$(time$, 6) + AMPM$ End Function |
| ||
Do you realize that you just asked how to convert 24-hour format into 12-hour format? =D |
| ||
I guess that was what I asked, @Soja :-D And thanks @WolRon. But I was not expecting a code snippet, I "believed" that the CurrentTime() somehow was able to automatically return 12-hour format time, but I guess not. |