<?php $currentDate = new \DateTime; echo 'Current Time: ' . $currentDate->format('h:i a') . PHP_EOL; $sd = "20th Dec, 2016"; $dt = DateTime::createFromFormat("dS M, Y", $sd); $strtotime = strtotime($dt->format("d-M-Y")); $dt2 = DateTime::createFromFormat("!dS M, Y", $sd); echo 'general' . \PHP_EOL; echo "\t" . $dt->format('Y-m-d h:i a') . \PHP_EOL; echo "\t" . $dt->getTimestamp() . \PHP_EOL; echo 'with !' . \PHP_EOL; echo "\t" . $dt2->format('Y-m-d h:i a') . \PHP_EOL; echo "\t" .$dt2->getTimestamp() . \PHP_EOL; echo 'strtotime' . \PHP_EOL; echo "\t" . date('Y-m-d h:i a', $strtotime) . PHP_EOL; echo "\t" . $strtotime . PHP_EOL;
You have javascript disabled. You will not be able to edit any code.