Unix Time

Anything QL Software or Programming Related.
Post Reply
User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Unix Time

Post by dilwyn »

Need to convert between QL time/date and Unix time/date.

As far as I can tell, Unix time seems to start at 00:00:00 1st January 1970, while the QL one same time in 1961.

So, would I be correct in thinking that all I need to do is add/subtract the number of seconds in the 9 year difference between the two time stamps. Which, allowing for leap years, is 283,996,800 (not including the occasional leap second corrections).

This is for QLirc to help with understanding time stamps received from an IRC server. So something like PRINT DATE$(time_stamp+283996800) seems to give the results I expect, but barely even knowing how to spell Unix, let alone know anything about it, I'd like more expert info, please.

TIA


User avatar
XorA
Site Admin
Posts: 1368
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Unix Time

Post by XorA »



User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: Unix Time

Post by dilwyn »

Thanks, XorA :ugeek:


User avatar
NormanDunbar
Forum Moderator
Posts: 2277
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Unix Time

Post by NormanDunbar »

Be grateful you don't need to worry about time zones!

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Unix Time

Post by swensont »

> Be grateful you don't need to worry about time zones!

If we just moved the Meridian line to run through San Francisco, the world would be much better. I don't know who picked that podunk of a town called London.

Tim


User avatar
Pr0f
QL Wafer Drive
Posts: 1306
Joined: Thu Oct 12, 2017 9:54 am

Re: Unix Time

Post by Pr0f »

swensont wrote:> Be grateful you don't need to worry about time zones!

If we just moved the Meridian line to run through San Francisco, the world would be much better. I don't know who picked that podunk of a town called London.

Tim
Perhaps because we had the foresight to come up with the concept of "common time" for a reguion - if you invent it you get to name it :-)

just be thankful it isn't called American Revised Standard Epoch ! :lol:


User avatar
vanpeebles
Commissario Pebbli
Posts: 2821
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Unix Time

Post by vanpeebles »

*shake fist at tim!*


swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Unix Time

Post by swensont »

> *shake fist at tim!*

As long as it's your fist that you are shaking at me and not something else.

Tim


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: Unix Time

Post by dilwyn »

swensont wrote:> *shake fist at tim!*

As long as it's your fist that you are shaking at me and not something else.

Tim
Probably code for parping at you, Tim.


Post Reply