note 97472 modified in function.timezone-abbreviations-list by danbrown
| From: | danbrown@php.net | Date: | Wed, 21 Apr 2010 21:57:47 +0000 |
| Subject: | note 97472 modified in function.timezone-abbreviations-list by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168487@lists.php.net to get a copy of this message | ||
This was driving me nuts so I'm adding a note here.
Took a while to get the simple time zone abbreviation for a given time zone. If you have the name
just do this:
<?php
$dateTime = new DateTime();
$dateTime->setTimeZone(new DateTimeZone('America/Los_Angeles'));
return $dateTime->format('T');
?>
Will return PST
--was--
This was driving me nuts so I'm adding a note here.
Took a while to get the simple time zone abbreviation for a given time zone. If you have the name
just do this:
$dateTime = new DateTime();
$dateTime->setTimeZone(new DateTimeZone('America/Los_Angeles'));
return $dateTime->format('T');
Will return PST
http://php.net/manual/en/function.timezone-abbreviations-list.php