Hi,
I'm storing the UTC dates into the DB using:
$utc = gmdate("M d Y h:i:s A");
and then I want to convert the saved UTC date to the client's local time.
How can I do that?
Thanks
Hi,
I'm storing the UTC dates into the DB using:
$utc = gmdate("M d Y h:i:s A");
and then I want to convert the saved UTC date to the client's local time.
How can I do that?
Thanks
date()
and localtime()
both use the local timezone for the server unless overridden; you can override the timezone used with date_default_timezone_set()
.
http://www.php.net/manual/en/function.date-default-timezone-set.php