I need to show the user the date of an event, depending on the time zone you are. Example ... If they are at 2014-10-22 11:05:00 (time of event) ...
madrid show 2014-10-22 18:05:00
or
Tokio show 2014-10-23 01:05:00
can you help me?
Thanks
I need to show the user the date of an event, depending on the time zone you are. Example ... If they are at 2014-10-22 11:05:00 (time of event) ...
madrid show 2014-10-22 18:05:00
or
Tokio show 2014-10-23 01:05:00
can you help me?
Thanks
DateTime
class is your friend here.
<?php
$date = new DateTime('2000-01-01', new DateTimeZone('Pacific/Nauru')); #What you have
echo $date->format('Y-m-d H:i:sP') . "\n";
$date->setTimezone(new DateTimeZone('Pacific/Chatham')); # What you want to spit out.
echo $date->format('Y-m-d H:i:sP') . "\n";
?>