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
Re: vbShortTime returns LongTime...
format("14:22:22","h.m.s")
or hh:mm:ss
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. :cry:
When the simple stuff doesn't work it makes my head spin...
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
Re: vbShortTime returns LongTime...
Quote:
Originally Posted by Trondyne
sTime = Format(Time, "h.m.s")
sTime is still passed the 12 hour AM/PM format. :cry:
works fine for me. doesn't give AM/PM.
Re: vbShortTime returns LongTime...
Sadly, it isn't working for me. The question is why?
Re: vbShortTime returns LongTime...
Changed:
Dim sTime As Date
to
Dim sTime
And this seems to solve the format problem.. Not sure why though.
Re: vbShortTime returns LongTime...
Oh. You didn't say that. I thought it was a string (cause of the sDate)