time to date php code example
Example 1: php timestamp to date
<?php
echo date('m/d/Y H:i:s', 1541843467);
?>
Example 2: php format date
<?php
$old_date_format = "20/03/1999";
$new_data_format = date("Y-m-d H:i:s", strtotime($old_date_format));
Example 3: php timestamp to date
<?php
echo date('m/d/Y H:i:s', 1541843467);
?>
Example 4: date time format php
$today = date("F j, Y, g:i a");
Example 5: phph date
<?php
date_default_timezone_set('UTC');
echo date("l");
echo date('l jS \of F Y h:i:s A');
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));
echo date(DATE_RFC2822);
echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000));
?>
Example 6: php date
$dateTime = new \DateTime();
$dateTime->format('Y-m-d H:i:s');