|
-
Feb 2nd, 2005, 02:58 AM
#1
Thread Starter
New Member
vbShortTime returns LongTime...
Hi all,
I am trying to return a 24 hour format using either FormatDateTime or Format.
However when this line executes:
sTime = FormatDateTime(Time, vbShortTime)
It returns the same long 12 hour value with AM/PM as does this:
sTime = FormatDateTime(Time, vbLongTime)
----------------
Any ideas?
Thanks,
Jim
-
Feb 2nd, 2005, 03:01 AM
#2
Re: vbShortTime returns LongTime...
format("14:22:22","h.m.s")
or hh:mm:ss
Last edited by dglienna; Feb 2nd, 2005 at 03:07 AM.
-
Feb 2nd, 2005, 03:13 AM
#3
Thread Starter
New Member
Re: vbShortTime returns LongTime...
Thanks, but using the syntax:
sTime = Format(Time, "h.m.s")
sTime is still passed the 12 hour AM/PM format.
When the simple stuff doesn't work it makes my head spin...
-
Feb 2nd, 2005, 03:21 AM
#4
Re: vbShortTime returns LongTime...
MsgBox Format(TimeSerial(14, 2, 2), "hh:mm:ss")
returns 14:02:02 for me
if I add AMPM it makes it 12 hour format
-
Feb 2nd, 2005, 03:30 AM
#5
Addicted Member
Re: vbShortTime returns LongTime...
 Originally Posted by Trondyne
sTime = Format(Time, "h.m.s")
sTime is still passed the 12 hour AM/PM format.
works fine for me. doesn't give AM/PM.
-
Feb 2nd, 2005, 09:45 AM
#6
Thread Starter
New Member
Re: vbShortTime returns LongTime...
Sadly, it isn't working for me. The question is why?
-
Feb 2nd, 2005, 04:34 PM
#7
Thread Starter
New Member
Re: vbShortTime returns LongTime...
Changed:
Dim sTime As Date
to
Dim sTime
And this seems to solve the format problem.. Not sure why though.
-
Feb 2nd, 2005, 04:40 PM
#8
Re: vbShortTime returns LongTime...
Oh. You didn't say that. I thought it was a string (cause of the sDate)
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
|