Req #81194 [Opn->Nab]: Get Timezone abbreviation

From: Date: Wed, 23 Jun 2021 08:28:56 +0000
Subject: Req #81194 [Opn->Nab]: Get Timezone abbreviation
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234599@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81194&edit=1 ID: 81194 Updated by: derick@php.net Reported by: syl dot fabre at gmail dot com Summary: Get Timezone abbreviation -Status: Open +Status: Not a bug Type: Feature/Change Request Package: Date/time related Operating System: Irrelevant PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The abbreviation depends on the date, for example whether Daylight Saving Time is in effect (EDT vs EST), and also on historical data. Abbreviations are not uniquely identifying a specific timezone either (PST can also be Pakistan Standard Time). Because these abbreviations are strictly display only marks (like am/pm), if would not be appropriate to have a specific method for this, and certainly not straight on DateTimezone. Previous Comments: ------------------------------------------------------------------------ [2021-06-23 07:58:08] syl dot fabre at gmail dot com Description: ------------ PHP uses the tz database for timezone with names like America/New_York. But most people in the US use abbreviated names like EST (for instance https://www.juneteenthny.com/schedule) This abbreviated name can be found with (new \DateTime('now', 'America/New_York'))->format('T') as explained in this comment: https://www.php.net/manual/en/function.timezone-abbreviations-list.php#97472 I would expect to get this abbreviation from a public method of \DateTimeZone with something like this: $tz = new \DateTimeZone('America/New_York'); $tz->getAbbreviation(); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81194&edit=1

« previous php.bugs (#234599) next »