eval.in

Paste #891850

PHP — PHP 7.0.8, pasted 2 months ago (json)

1
2
3
4
5
6
7
<?php
//echo "UP";
$dt = new DateTime("2017-04-11T06:33:00.001-07:00");
echo "BEFORE: ", $dt->format("c"), "\n";

$dt->setTimeZone(new DateTimeZone('Asia/Colombo'));
echo "AFTER: ", $dt->format('c'), "\n";

Program Output

BEFORE: 2017-04-11T06:33:00-07:00
AFTER: 2017-04-11T19:03:00+05:30

OK (0.020 sec real, 0.019 sec wall, 16 MB, 52 syscalls)

Fork