Source Code:
(back to article)
<?php $pacificTime = new DateTime('2022-03-01 09:00:00', new DateTimeZone('America/Los_Angeles')); $easternTime = clone $pacificTime; $easternTime->setTimezone(new DateTimeZone('America/New_York')); echo 'Pacific Time: ' . $pacificTime->format('Y-m-d H:i:s') . PHP_EOL; echo 'Eastern Time: ' . $easternTime->format('Y-m-d H:i:s');
Result:
Report an issue