Convert Seconds from 1980 to current date/time

J

Joe Williams

I have a wacky SQL application that stores a transaction date as the number
of seconds since 1/1/1980. I am being told this is common for C++
programmers to store dates in this manner.

Unfortunately, I am not a C++ programmer and therefore I need to get the
date converted to the proper date/time.

Is there a function that i can use to convert the number of seconds since
1980 to a proper date/time format? I am looking for the function to return
something along the lines of 7/12/2004 11:30 PM

Thanks in advance!

- Joe
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You might try this (in the debug window):

? dateadd("s",datediff("s","1/1/1980", now()),"1/1/1980")
7/13/2004 6:42:19 PM


--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQPSPy4echKqOuFEgEQIDrACg+BcvQUxKdaC8azQjzovA8o5GZ4MAn3vn
jfhBLChYdjyXW9wN///5bw9H
=UniB
-----END PGP SIGNATURE-----
 
J

John Vinson

I have a wacky SQL application that stores a transaction date as the number
of seconds since 1/1/1980. I am being told this is common for C++
programmers to store dates in this manner.

Unfortunately, I am not a C++ programmer and therefore I need to get the
date converted to the proper date/time.

Is there a function that i can use to convert the number of seconds since
1980 to a proper date/time format? I am looking for the function to return
something along the lines of 7/12/2004 11:30 PM

Thanks in advance!

- Joe

DateAdd("s", [C_Date], #1/1/1980#)

for example:

?DateAdd("s", 774230471, #1/1/1980#)
7/14/2004 12:01:11 AM

suggesting that my PC is about to turn into a pumpkin and I'd better
get to bed...
 

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