Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are there multiple timezone choices that all resolve to EST?

I need to add the ability to change timezones for North America only. There are a total of six timezones, including Hawaii and Alaska.

I am on the eastern part of the USA, so my timezone is Eastern. When choosing a timezone for my location, I can choose New York, Chicago and a few others. I'm not sure why there are so many different timezones that all resolve to the same offset; unless because of DST.

All I'm basically looking for are these six zones:

  • EST
  • CST
  • MST
  • PST
  • AKST
  • HST

Can someone tell me why there are so many different timezones to choose from that resolve to the same offset?

like image 323
NaN Avatar asked Mar 21 '23 23:03

NaN


1 Answers

The list of PHP timezones is pulled from the PECL timezone database. The PECL timezone database comes from the "Olson" database, which is maintained by the IANA organization.

On the IANA website, they state the following about their upkeep of the timezone database:

The Time Zone Database (often called tz or zoneinfo) contains code and data that represent the history of local time for many representative locations around the globe. It is updated periodically to reflect changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules. Its management procedure is documented in BCP 175: Procedures for Maintaining the Time Zone Database.

The topic of timezones is further complicated by the fact that not all states use daylight savings (Arizona, Hawaii, Puerto Rico, for example do not use daylight savings).

So, what one could conclude from this is that a timezone for a particular City is based on its zone boundaries, its daylight savings time rules, and other political factors. Thus, just because some city happens to be physically in the west does not mean it is guaranteed to be PST, for example.

Furthermore, by manually setting a western region to PST is technically less maintainable than it would be to set its actual country/city timezone identifier, so that way, should their offset change in the future, your application would continue to set the correct time.

like image 158
Kristian Avatar answered Apr 26 '23 03:04

Kristian