unix time in access

andr3w266

New member
Local time
Today, 02:50
Joined
Jan 19, 2007
Messages
3
hi all

I'm using MS Access 03 to run some queries on a SQL database. 2 of the columns i pull from SQL are about time, but are stored in 'unix time'. can this be converted once in Access to a more readable format eg ddmmyyyy?

any help would be much appreciated
 
Hello: Use the DateSerial Function

DateSerial Function
Returns a Variant (Date) for a specified year, month, and day.

Syntax

DateSerial(year, month, day)

The DateSerial function syntax has these named arguments:

Part Description
year Required; Integer. Number between 100 and 9999, inclusive, or a numeric expression.
month Required; Integer. Any numeric expression.
day Required; Integer. Any numeric expression.
'
Regards
Mark
 
I am sorry DATA but you probably dont know Unix anymore beeing so far from the future ;)

IIRC (google for it!) unix time is the number of seconds that expire since januari 1st 1970.
So what you (need to) do is take that time /60/60/24
This will return a double that is "Access compliant". Stick a date format on it and it will display the proper date.
 
Well... almost.

IIRC time is correctly the time as stated. Float it, divide by 86400, and then ADD the date constant # 31 Dec 1969 # to the result. THAT will be a proper Access date adjusted for immediate use in date-field computations.
 
The_Doc_Man said:
Well... almost.

IIRC time is correctly the time as stated. Float it, divide by 86400, and then ADD the date constant # 31 Dec 1969 # to the result. THAT will be a proper Access date adjusted for immediate use in date-field computations.
LOL@Doc

/60/60/24 = /86400 except I think it makes it a little more clear what one is calculating....
 

Users who are viewing this thread

Back
Top Bottom