Has anyone figured out a way for me to get the users timezone from their city?
Why You Should Use Timezone Offsets Not Timezone Names
21–30 of 51 posts
Re: Why You Should Use Timezone Offsets Not Timezone Names
#22I collect the users city on my site using gps/browser location opt in, or by autocomplete against google locations. Has anyone figured out a way for me to get the users timezone from their city?
Re: Why You Should Use Timezone Offsets Not Timezone Names
#23The political realities of timezones is _exactly why_ you should be storing the timezone name if the user is scheduling it for an event in their local timezone. If a user is expecting an event to happen at 6pm in their local timezone, and political reasons cause that timezone's offset to change (ie. daylight savings), it will still happen at the correct local time for that user. Storing UTC offsets means that any fut…
I wish they could at least store it in terms of the timezone name, like "Central Time". "America/Chicago" bothers me because I don't know what cities are and aren't in your timezone database. The ones that have a tiny map that you have to click on are also pretty bad.
"America/Chicago" is a standard timezone name.
Re: Why You Should Use Timezone Offsets Not Timezone Names
#24Earlier quoted context omitted.
I wish they could at least store it in terms of the timezone name, like "Central Time". "America/Chicago" bothers me because I don't know what cities are and aren't in your timezone database. The ones that have a tiny map that you have to click on are also pretty bad.
CST is not the same thing as America/Chicago. If you say CST you specifically do not mean daylight savings time, which is CDT.
Re: Why You Should Use Timezone Offsets Not Timezone Names
#25The political realities of timezones is _exactly why_ you should be storing the timezone name if the user is scheduling it for an event in their local timezone. If a user is expecting an event to happen at 6pm in their local timezone, and political reasons cause that timezone's offset to change (ie. daylight savings), it will still happen at the correct local time for that user. Storing UTC offsets means that any fut…
I wish they could at least store it in terms of the timezone name, like "Central Time". "America/Chicago" bothers me because I don't know what cities are and aren't in your timezone database. The ones that have a tiny map that you have to click on are also pretty bad.
(And I may be further proving your point if Denver isn't the landmark city, I'm just guessing!)
Re: Why You Should Use Timezone Offsets Not Timezone Names
#26Earlier quoted context omitted.
I think the main thing to remember is that dates and times have very different semantics when used for different purposes. If you are referring to an instant in time, then just using UTC is reasonable. If you are referring to a past event and both the local time and precise instant are relevant, then the local time with a timezone offset is reasonable. If you are scheduling events on a calendar, however, like "8 AM e…
TZDATA ships with historical timezone information, so using the timezone name should also work for past events, no?
Re: Why You Should Use Timezone Offsets Not Timezone Names
#27The political realities of timezones is _exactly why_ you should be storing the timezone name if the user is scheduling it for an event in their local timezone. If a user is expecting an event to happen at 6pm in their local timezone, and political reasons cause that timezone's offset to change (ie. daylight savings), it will still happen at the correct local time for that user. Storing UTC offsets means that any fut…
Which is why you are both right: Offsets are good for past events, time zones for future ones. It's a real pain to deal with..
[0] https://en.wikipedia.org/wiki/Tz_database
See: Example zone and rule lines
Re: Why You Should Use Timezone Offsets Not Timezone Names
#28Re: Why You Should Use Timezone Offsets Not Timezone Names
#29Re: Why You Should Use Timezone Offsets Not Timezone Names
#30Earlier quoted context omitted.
I wish they could at least store it in terms of the timezone name, like "Central Time". "America/Chicago" bothers me because I don't know what cities are and aren't in your timezone database. The ones that have a tiny map that you have to click on are also pretty bad.
https://www.iana.org/time-zones "America/Chicago" is a standard timezone name.
Personally, I (living in SF), use the "PST8PDT" named timezone; it just makes more sense to me than "America/Los Angeles", which is 400+ miles away from me (even though historically we've always had the same time as LA... as far as I know).
[0] Yes, there are a few places in the continental US that don't follow the "normal" 4 timezones and their DST schedules, so there are exceptions; specifically calling out those cities/locales is necessary, at least in those cases.