note 109321 modified in function.date-default-timezone-set by danbrown
| From: | danbrown@php.net | Date: | Mon, 16 Jul 2012 15:46:44 +0000 |
| Subject: | note 109321 modified in function.date-default-timezone-set by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189224@lists.php.net to get a copy of this message | ||
A simple method for conversation between two time
zone. <?php $date = new
DateTime("2012-07-05 16:43:21", new
DateTimeZone('Europe/Paris')); date_default_timezone_set('America/New_York'); echo
date("Y-m-d h:iA",
$date->format('U')); // 2012-07-05
10:43AM ?>
--was--
A simple method for conversation between two time zone.
$date = new DateTime("2012-07-05 16:43:21", new DateTimeZone('Europe/Paris'));
date_default_timezone_set('America/New_York');
echo date("Y-m-d h:iA", $date->format('U'));
// 2012-07-05 10:43AM
http://php.net/manual/en/function.date-default-timezone-set.php