ASPit - Totally ASP
.
Search PHPit

Use this textbox to search all the content on PHPit. Seperate keywords with a space.

Advertisements
Partners

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;

}
?>

Written by Dennis Pallett on April 02, 2004