note 77046 deleted from function.date by derick

From: Date: Sun, 09 Dec 2007 13:41:32 +0000
Subject: note 77046 deleted from function.date by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133012@lists.php.net to get a copy of this message
Note Submitter: ben78 ---- Find on the web. Diff between date seconds, minutes, hours, month, days and years! Very usefull and so simple :-) $d1=mktime(22,0,0,1,1,2007); $d2=mktime(0,0,0,1,2,2007); echo "Hours difference = ".floor(($d2-$d1)/3600) . "<br>"; echo "Minutes difference = ".floor(($d2-$d1)/60) . "<br>"; echo "Seconds difference = " .($d2-$d1). "<br>"; echo "Month difference = ".floor(($d2-$d1)/2628000) . "<br>"; echo "Days difference = ".floor(($d2-$d1)/86400) . "<br>"; echo "Year difference = ".floor(($d2-$d1)/31536000) . "<br>";

« previous php.notes (#133012) next »