Answers for "change date timezone php"

PHP
3

php change timezone

date_default_timezone_set('America/Los_Angeles');
Posted by: Guest on March-20-2020
1

php datetime set timezone

$date = new \DateTime();
$date->setTimezone(new \DateTimeZone('+0800')); //GMT
echo $date->format('Y-m-d H:i:s');
// 2020-11-20 15:23:49
Posted by: Guest on November-20-2020

Browse Popular Code Answers by Language