Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

convert utc to local time phpAdd Answer

// create a $dt object with the UTC timezone
$dt = new DateTime('2016-12-12 12:12:12', new DateTimeZone('UTC'));

// change the timezone of the object without changing its time
$dt->setTimezone(new DateTimeZone('America/Denver'));

// format the datetime
$dt->format('Y-m-d H:i:s T');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #utc #local #time #phpAdd #Answer
ADD COMMENT
Topic
Name
7+6 =