Page 1 of 1

Unix Time

Posted: Tue Mar 03, 2020 6:09 pm
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

Re: Unix Time

Posted: Tue Mar 03, 2020 7:03 pm
by XorA

Re: Unix Time

Posted: Tue Mar 03, 2020 7:40 pm
by dilwyn
Thanks, XorA :ugeek:

Re: Unix Time

Posted: Wed Mar 04, 2020 12:12 am
by NormanDunbar
Be grateful you don't need to worry about time zones!

Cheers,
Norm.

Re: Unix Time

Posted: Wed Mar 04, 2020 4:00 am
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

Re: Unix Time

Posted: Wed Mar 04, 2020 8:47 am
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:

Re: Unix Time

Posted: Wed Mar 04, 2020 9:58 am
by vanpeebles
*shake fist at tim!*

Re: Unix Time

Posted: Wed Mar 04, 2020 5:35 pm
by swensont
> *shake fist at tim!*

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

Tim

Re: Unix Time

Posted: Wed Mar 04, 2020 6:20 pm
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.