Military Time

M

Max

How can I change the time from millitary time (0900) to 9 or (0925) to 9.25.
Each one of these are in one feild.
 
C

Carole O

Hi, Max

If 09:15 was in C1, the formula in D1 would read =C1*24. But -- the answer
would not be 9.15, it would be 9.25 (15 minutes = 1/4 hour = .25 (1/4 of 100).

You'll notice that I entered the colon between 09 and 15. I think you would
have to format the military time to [hh]:mm (Format Cell Custom) in order for
this to work.

HTH,

Carole O
 
J

James Hahn

Divide the value into hours and minutes, and use the TimeSerial function to
convert these values to a time
t = TimeSerial( Int( v / 100 ), v - 100 * ( Int( v / 100 ) ), 0 )
 
M

Max

t = TimeSerial( Int( v / 100 ), v - 100 * ( Int( v / 100 ) ), 0 )

Where where I put this in my query or in the report.
 
J

James Hahn

If you aren't actually going to use it as a variable (for instance, for
doing some sort of comparison) then it's simplest just to insert it into the
report.
 
Top