Convert to militiary time 
Author Message
 Convert to militiary time

Any suggestions on the best way to convert data I have, using VBA?  My
fields StartTime and EndTime have data in the form of 09:25, 11:30, etc.  I
have a separate field AMPM that determines if the time is AM or PM.  I want
to change 01:30 to 13:30, etc.  Would I be able to use the LEFT function to
check each field in a recordset?  Would I have to create a string with the
LEFT function for the first two digits and the RIGHT function for the last
two digits so I can return the minutes after changing the hour?

Not sure where to start!  If someone has come across this already, I would
love to hear your solution.

Thanks!
Mark Hoffman



Tue, 06 Nov 2001 03:00:00 GMT
 Convert to militiary time

You could do something like this:

format(<time field> & " " & <AM/PM field>, "short time")
(basically append the time data and the am/pm data and then let the format
function format it as military (the output will be a string).
Just a thought...

--
Kevin Alons


Quote:
> Any suggestions on the best way to convert data I have, using VBA?  My
> fields StartTime and EndTime have data in the form of 09:25, 11:30, etc.
I
> have a separate field AMPM that determines if the time is AM or PM.  I
want
> to change 01:30 to 13:30, etc.  Would I be able to use the LEFT function
to
> check each field in a recordset?  Would I have to create a string with the
> LEFT function for the first two digits and the RIGHT function for the last
> two digits so I can return the minutes after changing the hour?

> Not sure where to start!  If someone has come across this already, I would
> love to hear your solution.

> Thanks!
> Mark Hoffman



Sat, 10 Nov 2001 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Convert a time from one time zone to another

2. help how to convert time string into time format

3. converting PST/PDT time to GMT time

4. How to Convert GMT(Greenwich) Time to short date and time and vice versa

5. medium time automatically converted to long time.

6. Converting Integer into a Date / Time and Calculating Elapsed time

7. Convert Quattro Pro time format to Paradox time format

8. Converting v3.5DOS Run-Time to v4.5w or v5.0w standard or Run-Time

9. Converting from UTC time to Local time

10. UDF to Convert UNIX time into 12 hour time

11. Time zones - convert local time to GMT

12. converting time from UTC to local time


 
Powered by phpBB® Forum Software