[RESOLVED] 12-hour Time function syntax
Hi all,
I'm making a clock-type program, and it outputs the time to a label, updating it with a timer (the timer code has "Label.caption = Time"). However, I have a checkbox that will allow the user to tick to display the time in a 12-hour format rather than 24hour. I've looked on MSDN as the format:time function, but I don't think it's what i need, either that or I'm not implementing it properly.
So basically, how do I use the "Time" function output 12-hour time?
Re: 12-hour Time function syntax
You need to use the format function:
VB Code:
'24 hours format
Label1.caption = Format(Time,"hh:mm")
'12 hours format
Label1.caption = Format(Time,"hh:mm AMPM")
Re: 12-hour Time function syntax
Ah! That's great, thank you :)