note 97472 modified in function.timezone-abbreviations-list by derick

From: Date: Mon, 21 Jun 2010 14:20:34 +0000
Subject: note 97472 modified in function.timezone-abbreviations-list by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-170345@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 [red.: Or PDT is the current date/time is during Daylight Savings Time] --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: <?php $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

« previous php.notes (#170345) next »