format time in php code example
Example 1: php time format
$today = date("F j, Y, g:i a");
$today = date("m.d.y");
$today = date("j, n, Y");
$today = date("Ymd");
$today = date('h-i-s, j-m-y, it is w Day');
$today = date('\i\t \i\s \t\h\e jS \d\a\y.');
$today = date("D M j G:i:s T Y");
$today = date('H:m:s \m \i\s\ \m\o\n\t\h');
$today = date("H:i:s");
$today = date("Y-m-d H:i:s");
Example 2: php get current time and date
date("Y-n-j G:i:s");
Example 3: date in php
$dateTime = new \DateTime();
$dateTime->format('Y-m-d H:i:s');
Example 4: date time format php
$today = date("F j, Y, g:i a");
Example 5: php date
$dateTime = new \DateTime();
$dateTime->format('Y-m-d H:i:s');