|
-
Dec 8th, 2005, 04:54 AM
#1
Thread Starter
Addicted Member
[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?
-
Dec 8th, 2005, 05:03 AM
#2
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")
-
Dec 8th, 2005, 05:14 AM
#3
Thread Starter
Addicted Member
Re: 12-hour Time function syntax
Ah! That's great, thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|