News for hackers. Stuff that matters.
Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by joshspankit on Sunday November 19, 2023 @11:08AM (#38333919)
If someone expresses it that way it will be a huge hassle the moment they decide one store opens at a different time.
Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by Buttons840 on Sunday November 19, 2023 @11:16AM (#38334015)
So maybe individual stores can customize their opening time, but corporate still wishes to store a default. How do you represent the default? How do you handle the DST time changes for individual stores?

I'm trying to poke holes in the "always use UTC and you're good" advice. I have actually encountered this scenario, and I didn't know how to apply that advice.

Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by bpfrh on Sunday November 19, 2023 @11:32AM (#38334222)
I don't get your problem, couldn't you store it like this: table timetable:

open | close | store 6am | 6am | default 7am | 12pm | store1

table stores: name | address store1 | xyx NYC

If you can't find the store in the timetable:

1. Get the timezone of the target store by looking up the address from the table stores

2. Set Hours from the default row in the timetable table on the object with the timezone

Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by Izkata on Sunday November 19, 2023 @12:58PM (#38335520)
> I'm trying to poke holes in the "always use UTC and you're good" advice.

There's a much simpler one - recurring meetings/events (in-person or local-ish like within one country) that cross a DST boundary. You always want these to be attached to a local time zone, so it doesn't suddenly happen an hour earlier/later than you intended.

Re:It's Time for a Change: Datetime.utcnow() Is Now Deprecated by fragmede on Sunday November 19, 2023 @02:16PM (#38336623)
Where that gets even more fun is with international meetings, where the host of the meeting and the attendees are in different zones.