<?php var_dump(date_default_timezone_get()); // Note: The unix timestamp used is the time this entry was created, not 2016-12-18 var_dump((new \DateTime("2016-12-18"))->format('c')); var_dump((new \DateTime("12/18/2016"))->format('c')); var_dump((new \DateTime("@1479664889"))->format('c')); var_dump((DateTime::createFromFormat("Y-m-d", "2016-12-18"))->format('c')); var_dump((DateTime::createFromFormat("m/d/Y", "12/18/2016"))->format('c')); var_dump((DateTime::createFromFormat("U", "1479664889"))->format('c')); print "---\n"; $lastExample = DateTime::createFromFormat("d/m/Y", "12/18/2016"); var_dump($lastExample->format('c')); var_dump(DateTime::getLastErrors()); $lastExample->setTimeZone(new \DateTimeZone("America/New_York")); var_dump($lastExample->format('c'));
You have javascript disabled. You will not be able to edit any code.