24 Hours Time

IgorB

Registered User.
Local time
Today, 08:16
Joined
Jun 4, 2003
Messages
183
I am trying to insert Time to TEXT field by using Format(Now(),'hh:nn:ss AMPM') like:

DoCmd.RunSql "Insert into TableTimes(MyTime) values(Format(Now(),'hh:nn:ss AMPM')".

With Morning Time I am OK: 08:14:23 AM.
Afternoon Time like 01:20:32 PM should look like 13:20:32 PM!!!!!

How should I store time like this 13:20:32 PM (mean 24 hours format) in TEXT FIELD?

Thanks.
 
AM/PM = 12 hours clock

00 - 23 hours = 24 hours clock.

You want to mix up the 2....

Regards
 
The format is working OK as you're using the twelve hour clock format.
13:20:32 PM doesn't exist....

RV
 
Thaks a lot Namliam.
You are right. Without AM/PM it allows me to store with 24 hours format!!!
 
One question: why would you want to store the time as a text value?

It saves space to store it as a Date/Time data type (only 8 bytes) whereas the 24 hour clock as text will take up 18 bytes.

You only need to format for displays in queries, forms, and reports.
 
Mailman

IgorB said:
Thaks a lot Namliam.
You are right. Without AM/PM it allows me to store with 24 hours format!!!

No thanks.
BTW, I'm definitely NOT Namliam the Mailman from Amsterdam :mad:

RV
 
RV said:
I'm definitely NOT Namliam the Mailman from Amsterdam :mad:

I think he was actually responding to namliam's post prior to yours. ;)
 
Mile-O-Phile said:
I think he was actually responding to namliam's post prior to yours. ;)

Actually, I think I wasn't thinking or thinking too much missing "Mailman's" response (he beat me by a whole minute..)

RV
 
To Mile-O-Phile.
Your Location shows Glasgow, Scotland in Russian letters.
Are you from there?
 

Users who are viewing this thread

Back
Top Bottom