Date conversion: seconds since 1970

M

Mike

Hi all

I've a web application that stores data using something that's very common
in the UNIX world: the seconds since some date in 1970.
This produces something like 1059581674 for 07-30-2003 04:14pm
This data is stored in a SQL database, and I'm accessing it with Access via
ODBC.
How can I "convert" those dates, so they're shown properly? Is there a
function to do that, or do I've to do all the divisions sepparately?
Thank you in advance.
Cheers,
 
J

John Vinson

Hi all

I've a web application that stores data using something that's very common
in the UNIX world: the seconds since some date in 1970.
This produces something like 1059581674 for 07-30-2003 04:14pm
This data is stored in a SQL database, and I'm accessing it with Access via
ODBC.
How can I "convert" those dates, so they're shown properly?

DateAdd("s", [UnixDate], #1/1/1970 00:00:00#)

will do the trick - from the Immediate window, working backward:

?dateadd("s",-1059581674,#07-30-2003 04:14pm#)
12/31/1969 11:59:26 PM

So 34 seconds off... close enough for me!

You may want to add a Date/Time field to the table and run an Update
query updateing it to the DateAdd expression above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top