symfony datetime now

37

symfony get current datetime -

$time = new \DateTime();
echo $time->format('H:i:s \O\n Y-m-d');

symfony datetime now -

$date = new \DateTime('@'.strtotime('now'));

symfony get current datetime -

$time = date('H:i:s \O\n d/m/Y');

Comments

Submit
0 Comments