News for hackers. Stuff that matters.
Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by jomoho on Sunday November 19, 2023 @04:37PM (#38338403)
Every heard of daylight savings time (DST)?
Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by capableweb on Sunday November 19, 2023 @04:39PM (#38338427)
Can be adjust client-side, or wherever you need to present it, rather than adjusting stored data.
Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by mulmen on Sunday November 19, 2023 @04:47PM (#38338542)
This is only sometimes true. Cases like opening hours and daily batch processing rely on local time. Persisting the values in UTC mean best case you are wrong half of the year and worst case all of it.
Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by capableweb on Sunday November 19, 2023 @05:17PM (#38338939)
Just because you're storing the time in UTC doesnt mean you can't also store the timezone, and lots of other related data too.
Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by mulmen on Sunday November 19, 2023 @05:48PM (#38339322)
6am in my time zone is two different times in UTC. Right now it is 14:00 UTC. But when DST starts it will be 13:00. So what UTC value do you insert into your database for the opening time of the coffee shop? And how do you convert?