GetTime()

Blitz3D Forums/Blitz3D Beginners Area/GetTime()

DNielsen(Posted 2004) [#1]
@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 ?


WolRon(Posted 2004) [#2]
What is this GetTime()?


DNielsen(Posted 2004) [#3]
UUPS!
Meant CurrentTime() ;-)


WolRon(Posted 2004) [#4]
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



soja(Posted 2004) [#5]
Do you realize that you just asked how to convert 24-hour format into 12-hour format? =D


DNielsen(Posted 2004) [#6]
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.