Hacker News new | ask | show | jobs
by juddgaddie 1959 days ago
'There is no good reason to use short timezone codes like EST, CST, PST — doing so will only bring you pain. Either use the tzdb name like America/New_York, or use an offset from UTC, depending on what you want.'

All you need to read/remember is this, this applies everywhere not just with date.

2 comments

The problem is peoples fascination with the S in the timezones, if you remove the S and the timezone equates to the proper, daylight savings adjusted +/- timezone according to the tz db. So instead of EST,CST,PST, use ET,CT,PT. For example ET equating to America/New_York, or as I prefer, US/Eastern. Traditional posix such as EST5EDT can have data gaps which cause issues that the tz db make up for, so in general:

Just use UTC for most things.

As with all things time, I'm no expert, and could be wrong about something. If you are, please correct me!

>As with all things time, I'm no expert, and could be wrong about something. If you are, please correct me!

Easy example that I have to deal with semi-regularly since I live and work in Mountain Time: Arizona. Arizona is under Mountain Time, but does not observe Daylight Savings. So America/Phoenix would work fine (and America/Denver for the rest of the Mountain Time zone) but simply using MT would not.

To complicate matters even more is that the Navajo reservation (which is partially in Arizona) observes DST, but the Hopi Reservation (also in Arizona, but completely surrounded by the Navajo Reservation) does not.

Unfortunately the statement is not true. One good reason to use short timezone codes like EST, CST, PST is that most people prefer them.

One of the first surprising things you learn after launching a timezone conversion website https://news.ycombinator.com/item?id=1133613 is that one of the top feature requests is to display short timezone codes.

And people prefer them because I have known since I was like 4 that I'm on Eastern time but have exactly zero idea what my UTC offset is off the top of my head. And also because I observe daylight savings EST changes automatically for me while I have to remember whether I'm in DST to know my UTC offset.