Time Values

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

I am parsing and inputting file data into the database.

I have a time value of 1205206829 that corresponds to 3/10/2008 11:40 pm. I
have tried a number of time formats but I can not get it to work out - any
help would be appreciated.

I believe the number format starts in 1970 because when I divide the number
by 31556736 I get 38.

Thanks.
 
Try using the following expression to convert the time value to an Access
DateTime value.

DateAdd("s",YourNumberValue,#1/1/1970#)

That returns 3/11/2008 3:40:29 AM for 1205206829

Which is off by 4 hours if your statement -"1205206829 that corresponds to
3/10/2008 11:40 pm" - is correct . I am guessing that the offset is due to
a conversion from some universal standard time to local time

You can adjust that by subtrracting 4 hours to convert to your local time.

DateAdd("h",-4,DateAdd("s",YourNumberValue,#1/1/1970#))

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top