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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
date()andlocaltime()both use the local timezone for the server unless overridden; you can override the timezone used withdate_default_timezone_set().http://www.php.net/manual/en/function.date-default-timezone-set.php
https://www.php.net/manual/en/function.date.php
http://php.net/manual/en/function.localtime.php