3 karma · joined Apr 21, 2013 (13y ago) · 5 submissions
comment 6y ago · link · parent
comment 13y ago · link · parent
"Luckily, the browser already knows what timezone the user is currently in, so we can make use of the getTimezoneOffset() function"
Getting the timezone offset isn't the same as getting the timezone. Granted that in certain cases having the offset is good enough, but sometimes you need the actual timezone. In my example I needed to know when a merchant wants their pre-order to be released. For that to work predictably I needed to know their exact timezone in order to adjust the time for daylight saving properly. Remember that there are quite a few timezones that are UTC-7 and they can behave differently in regards to daylight saving.