doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

DateTimeZone does not return canonical timezone names for legacy/alias identifiers

Open bedwal-deepak opened this issue 1 month ago • 0 comments

From manual page: https://php.net/datetimezone.listidentifiers


The DateTimeZone class in PHP is not returning canonical timezone names when using valid alias/legacy identifiers such as:

  • US/Eastern (expected: America/New_York)
  • US/Central (expected: America/Chicago)
  • Canada/Eastern (expected: America/Toronto)
  • US/Pacific (expected: America/Los_Angeles)
  • US/Hawaii (expected: Pacific/Honolulu)
  • Etc/GMT (expected: Etc/GMT but validation fails in DateTimeZone::listIdentifiers())

These timezones are accepted by new DateTimeZone(), but:

  • They do not appear in DateTimeZone::listIdentifiers(), causing validation rules to fail.
  • DateTimeZone::getName() and DateTime::format('e') return the same alias instead of the canonical name.

bedwal-deepak avatar Nov 27 '25 10:11 bedwal-deepak