php get date string code example
Example 1: 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 2: php get date
date("Y-m-d h:i:sa")
Example 3: create date from string php
$element = '15-Feb-2009';
$date = DateTime::createFromFormat('j-M-Y', $element);
Example 4: 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));
?>