Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

PHP - Date difference function

function DateDiff($interval, $date1, $date2) { // Function roughly equivalent to the ASP "DateDiff" function //convert the dates into timestamps $date1 = strtotime($date1); $date2 = strtotime($date2); $seconds = $date2 - $date1; //if $date1 > $date2 //change substraction order //convert the diff to +ve integer if ($seconds



This post first appeared on Smash Scripts, please read the originial post: here

Share the post

PHP - Date difference function

×

Subscribe to Smash Scripts

Get updates delivered right to your inbox!

Thank you for your subscription

×