Req #54210 [Com]: provide a function to canonicalize timezone strings
Edit report at http://bugs.php.net/bug.php?id=54210&edit=1
ID: 54210
Comment by: giorgio dot liscio at email dot it
Reported by: giorgio dot liscio at email dot it
Summary: provide a function to canonicalize timezone strings
Status: Bogus
Type: Feature/Change Request
Package: Date/time related
Operating System: all
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
exact, it is not a problem implement this in the user space
but it is nonsense since some php functions requires a canonical tz
string
Previous Comments:
------------------------------------------------------------------------
[2011-03-10 14:54:45] dtajchreber@php.net
Not that it's hard to implement in userland code but it'd be nice if the
DateTimezone class gave the timezone name in canonical form... I don't
see why
it shouldn't either?
$dt = new DateTimezone('america/chicago');
var_dump($dt->getName()); /* string(15) "america/chicago" */
vs.
$dt = new DateTime();
var_dump($dt->getTimezone()->getName()); /* string(16)
"Australia/Sydney" */
------------------------------------------------------------------------
[2011-03-10 07:16:23] scottmac@php.net
$tz = implode('/', array_map('ucfirst', explode('/', $tz)));
No need to add a new function for this, and if the timezone is set by
your app
then you should probably store it in the correct format.
------------------------------------------------------------------------
[2011-03-10 07:16:21] scottmac@php.net
$tz = implode('/', array_map('ucfirst', explode('/', $tz)));
No need to add a new function for this, and if the timezone is set by
your app
then you should probably store it in the correct format.
------------------------------------------------------------------------
[2011-03-09 23:28:25] giorgio dot liscio at email dot it
Description:
------------
hi, it is needed a function that converts "europe/rome" in
"Europe/Rome"
for example the intl module (ICU) of php 5.3 does not accept
"europe/rome" as timezone, but only "Europe/Rome", with uppercase first
letters
thank you
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54210&edit=1
Thread (5 messages)