468,514 Members | 1,588 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

Unix Time

Tom
A field in a data set I want to import into Access is in Unix time (seconds from
a certain time on a certain date). Does anyone know the precise date and the
precise time on that date that Unix is based on?

How do I calculate the Date when I have Unix seconds? Will the calculation take
into account leap years?

Thanks!

Tom
Nov 12 '05 #1
5 4276
Use DateAdd() to get the number of seconds since the start date.

For example, the 50000 seconds since 1/1/1980 would be:
DateAdd("s", 50000, #1/1/1980#)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tom" <th******@earthlink.net> wrote in message
news:v4*****************@newsread1.news.atl.earthl ink.net...
A field in a data set I want to import into Access is in Unix time (seconds from a certain time on a certain date). Does anyone know the precise date and the precise time on that date that Unix is based on?

How do I calculate the Date when I have Unix seconds? Will the calculation take into account leap years?

Nov 12 '05 #2
TC
Unix base time is 00:00:00 GMT 1 January 1970.

HTH,
TC
"Tom" <th******@earthlink.net> wrote in message
news:v4*****************@newsread1.news.atl.earthl ink.net...
A field in a data set I want to import into Access is in Unix time (seconds from a certain time on a certain date). Does anyone know the precise date and the precise time on that date that Unix is based on?

How do I calculate the Date when I have Unix seconds? Will the calculation take into account leap years?

Thanks!

Tom


Nov 12 '05 #3
Tom
Allen,

TC said in his response <<Unix base time is 00:00:00 GMT 1 January 1970>>. Is it
1970 or 1980?

Is the base time 00:00:00 GMT ?

Do you need to account for time zone difference in the calculation?

Your DateAdd function has no element of base time only base date. Does DateAdd
default to 00:00:00 when the calculation is explicitly seconds "s"?

If the number of seconds spanned numerous years, does DateAdd account for leap
years that occured in those years?

Thanks for your time!!

Tom
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:3f**********************@freenews.iinet.net.a u...
Use DateAdd() to get the number of seconds since the start date.

For example, the 50000 seconds since 1/1/1980 would be:
DateAdd("s", 50000, #1/1/1980#)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tom" <th******@earthlink.net> wrote in message
news:v4*****************@newsread1.news.atl.earthl ink.net...
A field in a data set I want to import into Access is in Unix time

(seconds from
a certain time on a certain date). Does anyone know the precise date and

the
precise time on that date that Unix is based on?

How do I calculate the Date when I have Unix seconds? Will the calculation

take
into account leap years?


Nov 12 '05 #4
DFS
Tom,

This website http://cr.yp.to/proto/utctai.html might help.
"Tom" <th******@earthlink.net> wrote in message
news:Qn*****************@newsread2.news.atl.earthl ink.net...
Allen,

TC said in his response <<Unix base time is 00:00:00 GMT 1 January 1970>>. Is it 1970 or 1980?

Is the base time 00:00:00 GMT ?

Do you need to account for time zone difference in the calculation?

Your DateAdd function has no element of base time only base date. Does DateAdd default to 00:00:00 when the calculation is explicitly seconds "s"?

If the number of seconds spanned numerous years, does DateAdd account for leap years that occured in those years?

Thanks for your time!!

Tom
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:3f**********************@freenews.iinet.net.a u...
Use DateAdd() to get the number of seconds since the start date.

For example, the 50000 seconds since 1/1/1980 would be:
DateAdd("s", 50000, #1/1/1980#)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tom" <th******@earthlink.net> wrote in message
news:v4*****************@newsread1.news.atl.earthl ink.net...
A field in a data set I want to import into Access is in Unix time

(seconds from
a certain time on a certain date). Does anyone know the precise date
and the
precise time on that date that Unix is based on?

How do I calculate the Date when I have Unix seconds? Will the
calculation take
into account leap years?



Nov 12 '05 #5
DateAdd() simply performs a calculation. If the number of seconds includes
leap years, Access knows that. The limit is that DateAdd() expects a signed
long integer (4-byte). For seconds, that's around 67 years from memory.

DateAdd() makes no adjustment for timezones. If you needed to add 7 hours to
adjust for a time zone, you could use another DateAdd() or just:
DateAdd("s", [HowManySeconds], #1/1/1970 7:00:00#)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tom" <th******@earthlink.net> wrote in message
news:Qn*****************@newsread2.news.atl.earthl ink.net...
Allen,

TC said in his response <<Unix base time is 00:00:00 GMT 1 January 1970>>. Is it 1970 or 1980?

Is the base time 00:00:00 GMT ?

Do you need to account for time zone difference in the calculation?

Your DateAdd function has no element of base time only base date. Does DateAdd default to 00:00:00 when the calculation is explicitly seconds "s"?

If the number of seconds spanned numerous years, does DateAdd account for leap years that occured in those years?

Thanks for your time!!

Tom
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:3f**********************@freenews.iinet.net.a u...
Use DateAdd() to get the number of seconds since the start date.

For example, the 50000 seconds since 1/1/1980 would be:
DateAdd("s", 50000, #1/1/1980#)

"Tom" <th******@earthlink.net> wrote in message
news:v4*****************@newsread1.news.atl.earthl ink.net...
A field in a data set I want to import into Access is in Unix time

(seconds from
a certain time on a certain date). Does anyone know the precise date
and the
precise time on that date that Unix is based on?

How do I calculate the Date when I have Unix seconds? Will the
calculation take
into account leap years?

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Matthew | last post: by
5 posts views Thread by jrefactors | last post: by
22 posts views Thread by Ryan M | last post: by
5 posts views Thread by francescomoi | last post: by
2 posts views Thread by Luis P. Mendes | last post: by
22 posts views Thread by Xah Lee | last post: by
37 posts views Thread by David T. Ashley | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.