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
Unix Time
- NormanDunbar
- Forum Moderator
- Posts: 2277
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Leeds, West Yorkshire, UK
- Contact:
Re: Unix Time
Be grateful you don't need to worry about time zones!
Cheers,
Norm.
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.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Unix Time
> 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
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
Re: Unix Time
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 itswensont 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
just be thankful it isn't called American Revised Standard Epoch !
- vanpeebles
- Commissario Pebbli
- Posts: 2821
- Joined: Sat Nov 20, 2010 7:13 pm
- Location: North East UK
Re: Unix Time
> *shake fist at tim!*
As long as it's your fist that you are shaking at me and not something else.
Tim
As long as it's your fist that you are shaking at me and not something else.
Tim
Re: Unix Time
Probably code for parping at you, Tim.swensont wrote:> *shake fist at tim!*
As long as it's your fist that you are shaking at me and not something else.
Tim
--
All things QL - https://dilwyn.qlforum.co.uk/index.html
All things QL - https://dilwyn.qlforum.co.uk/index.html