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