Re:Perl code that is syntactically correct only on Fridays
by dheera on Wednesday February 16, 2022 @01:21PM
(#30363611)
Use UTC UNIX timestamps (i.e. Date.now()) for ALL time-related processing and only convert to hours/minutes when taking input/output from the user.
[ Parent
| on HN ]
Re:Perl code that is syntactically correct only on Fridays
by mypalmike on Wednesday February 16, 2022 @03:37PM
(#30365351)
That's a good starting point, and certainly good advice for marking current time and past times. But keep in mind that future event absolute UTC can change due to politics, e.g. a change in daylight savings rules, which is less rare than you might imagine (https://en.m.wikipedia.org/wiki/Daylight_saving_time_by_coun...). That concert scheduled a year from now at 8pm in UTC+5 might actually end up occurring at 8pm in UTC+6.
Re:Perl code that is syntactically correct only on Fridays
by notreallyserio on Thursday February 17, 2022 @12:18AM
(#30369775)
> certainly good advice for marking current time and past times
But not too far past!
Re:Perl code that is syntactically correct only on Fridays
by aidos on Wednesday February 16, 2022 @01:47PM
(#30363980)
Uh oh, we’re going there again. If you’re doing anything in the future, that’s not always the correct thing to do. (Instants vs wall time etc)
Re:Perl code that is syntactically correct only on Fridays
by amalcon on Thursday February 17, 2022 @09:09AM
(#30373184)
I once had briefly traveled into a different time zone (so briefly that I hadn't thought about it) when I received a phone call asking to reschedule a doctor appointment. I entered the new time into my calendar. Then, I was an hour late to the appointment. My phone had adopted the timezone of the cell tower, and the calendar assumed I had meant "local time where I scheduled the appointment".
Re:Perl code that is syntactically correct only on Fridays
by misnome on Wednesday February 16, 2022 @07:45PM
(#30368083)
But I want my 4pm weekly meeting to always happen at 4pm, even if DST changes.
Re:Perl code that is syntactically correct only on Fridays
by dheera on Thursday February 17, 2022 @01:55PM
(#30377087)
If DST changes and you live in a democracy, it's your fault. Vote against DST. If you don't get what you want unleash the wrath on your congress member, not the software.