date time format php simple code example
Example 1: datetime php
$dateTime = new \DateTime();
$dateTime->format('Y-m-d H:i:s');
Example 2: date time format php
$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
$dateTime = new \DateTime();
$dateTime->format('Y-m-d H:i:s');
$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm