4 ms·
Let's say you host a store front for many businesses and it's decided that your customers, who are businesses, some with many stores, want to store a default op
by Buttons840 3y ago
Let's say you host a store front for many businesses and it's decided that your customers, who are businesses, some with many stores, want to store a default opening time. Something along the lines of "All Home Depot's open a 6 AM, all Lowes open at 7 AM."
- wayfinder 3y agoThat’s not date data though. That’s just storing local time - 6 AM or 7 AM.
- sillysaurusx 3y agoThe store property would be "6 AM". Anywhere it’s used, it’s running in the context of humans. When displaying on a website, you don’t need to do any conversions: the human viewing the store knows where it’s located, and they know the current time, so computers don’t need to answer the question of whether it’s open. If computers do need to know, then they’ll need to know a specific store with a physical location. That gives you the time zone.
- macintux 3y ago> If computers do need to know, then they’ll need to know a specific store with a physical location. That gives you the time zone. Mapping a location to a time zone seems fraught with peril. I’d store the local time zone explicitly.
- amluto 3y agoIndeed. And anyone near a time zone boundary looking at an online map of store locations doesn’t want to see “opens at 6AM” or whatever — they want to know whether the store is open.
- JJMcJ 3y agoIndeed. It's not as bad as mapping address => sales tax (no ZIP Code isn't good enough), but only because it doesn't change as often and tends to follow county boundaries when it doesn't follow state boundaries. Another good example. Arizona doesn't follow Daylight Savings, but the Navajo Nation, which includes the Four Corners area and is in three states, does observe the change. However the Hopi reservation, completely surrounded by Navajo territory, is entirely in Arizona, and does not observe DST. So it can get quite complicated and it's not enough to say "Arizona doesn't have Daylight Savings Time".
- efdee 3y agoThere's no time zones involved in that at all. Nobody is going to be checking the opening hours of a Home Depot in another timezone and expect to get the date in their local timezone.
- blincoln 3y ago> Nobody is going to be checking the opening hours of a Home Depot in another timezone and expect to get the date in their local timezone. You've never wanted to call a business in another timezone before making the trip out there?
- efdee 3y agoI've never visited a brick and mortar store's website to check their opening hours and assumed it would be anything other than in their local timezone.
- Wowfunhappy 3y ago...I can see this use case. However, if I look up the opening time of a Home Depot in another time zone, I expect the result to be in that store's local time! I'll do the conversion myself. If I get my local time instead, I'll still perform the conversion, and get the wrong result. You could just decide that any time listed anywhere on the internet should include a timezone... but that would be nuts.