note 109757 deleted from function.date-default-timezone-set by danbrown
| From: | danbrown@php.net | Date: | Fri, 31 Aug 2012 15:54:46 +0000 |
| Subject: | note 109757 deleted from function.date-default-timezone-set by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190350@lists.php.net to get a copy of this message | ||
Note Submitter: chris at cmbuckley dot co dot uk
----
Pierre Gourlaouen: there is no reason to use either of the date functions for this:
<?php
$date = new DateTime("2012-07-05 16:43:21", new DateTimeZone('Europe/Paris'));
$date->setTimezone(new DateTimeZone('America/New_York'));
echo $date->format('Y-m-d h:iA'); // 2012-07-05 10:43AM