converts military time into standard AM/PM .

  • Thread starter turks67 via AccessMonster.com
  • Start date
T

turks67 via AccessMonster.com

Is it possible to convert military time to standard time.

examples: 15.00 to 3:00:00 PM

16.30 to 4:30:00 PM

10.00 to 10:00 AM

20.05 to 8:05:00 PM


Can someone lead me in the right direction.
 
C

Clifford Bass

Hi,

The display form of a date/time is not relavant to it's contents. It
can be displayed in a large variety of formats. Is this a stored value or
something else? What is your goal here? Please expand.

Clifford Bass
 
T

Tom van Stiphout

On Thu, 23 Jul 2009 21:28:55 GMT, "turks67 via AccessMonster.com"

Have you tried the Format function:
?format(#15.00#, "Long Time")
3:00:00 PM
Or specify the format explicitly - see help file.

-Tom.
Microsoft Access MVP
 
J

John Spencer

Lots of ways, depending on whether or not your time is stored as a
string or as a number

As a number you can use the time serial function

?Timeserial(Int(16.30),(16.30 * 100) mod 100,0)
4:30:00 PM

?As a string or date value then
?TimeValue("16.30")
4:30:00 PM

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
T

turks67 via AccessMonster.com

Thank you.

John said:
Lots of ways, depending on whether or not your time is stored as a
string or as a number

As a number you can use the time serial function

?Timeserial(Int(16.30),(16.30 * 100) mod 100,0)
4:30:00 PM

?As a string or date value then
?TimeValue("16.30")
4:30:00 PM

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
Is it possible to convert military time to standard time.
[quoted text clipped - 7 lines]
Can someone lead me in the right direction.
 
J

John W. Vinson

Is it possible to convert military time to standard time.

examples: 15.00 to 3:00:00 PM

16.30 to 4:30:00 PM

10.00 to 10:00 AM

20.05 to 8:05:00 PM


Can someone lead me in the right direction.

What is the datatype of the military time field: date/time, text, number? It
could be any of the three, and any of them can be converted - but the
technique would be different for each.
 
T

turks67 via AccessMonster.com

The datatype of military time field is number.
Is it possible to convert military time to standard time.
[quoted text clipped - 7 lines]
Can someone lead me in the right direction.

What is the datatype of the military time field: date/time, text, number? It
could be any of the three, and any of them can be converted - but the
technique would be different for each.
 
J

John Spencer

Yeah, I was too lazy to ask the question about data type. I just gave him
solutions for all three data types and then let him figure out which one to use.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top