Answers for "datetime format with timezone php"

PHP
3

datetime php

$dateTime = new \DateTime();
$dateTime->format('Y-m-d H:i:s');
Posted by: Guest on June-15-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

Code answers related to "datetime format with timezone php"

Browse Popular Code Answers by Language