Get current datestamp
With this function you can easily retrieve the current date stamp. Very useful for comparing it with data from a MySQL database.
function get_current_datestamp(){
//get the current timestamp
$currdate = gmdate("Ymd");
$currday = substr($currdate,6,2);
$currmonth = substr($currdate,4,2);
$curryear = substr($currdate,0,4);
$currdate_stamp = ($curryear . "-" . $currmonth . "-" . $currday);
return $currdate_stamp;
}
?>
January 6th, 2006 at 7:00 pm
You get the same thing by
date(”Y-m-d”);