m:
I have a table that has a date/time field. I'm going to be
importing date/time field that is in UTC format. When the data
gets imported my date/time data gets converted to a 12 hr AM PM
time stamp. How do I keep this from happening? I want to keep my
date/time data as UTC
No, it's not getting converted -- it's only being formatted for
display with AM/PM.
Jet date values are stored as an Integer value for the day (since
12/30/1899), and a decimal value for the time of day (.5 would be
noon). You can see this by typing a few values in the immediate
window.
?Format(0,"m/d/yyyy")
12/30/1899
?Format(.5,"m/d/yyyy hh:nn:ss AM/PM")
12/30/1899 12:00:00 PM
?Format(.7,"m/d/yyyy hh:nn:ss AM/PM")
12/30/1899 04:48:00 PM
?Format(.7,"m/d/yyyy hh:nn:ss")
12/30/1899 16:48:00
Thus, in the controls on your forms or reports, you need to set the
format property of your date/time fields to some variation on:
m/d/yyyy hh:nn:ss
m/d/yyyy h:nn:ss
mm/dd/yyyy hh:nn:ss
None of the named formats support 24-hour time, so you have to
create your own.
Another alternative would be to set the format property
appropriately in the table design. This will be inherited in all the
queries/forms/reports you use that table in.