note 61203 deleted from function.getdate by bobby

From: Date: Fri, 08 Sep 2006 14:57:22 +0000
Subject: note 61203 deleted from function.getdate by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-116918@lists.php.net to get a copy of this message
Note Submitter: mbaart at planet dot nl ---- A simple way to calculate the days between to timestamps: <?php if( $first_timestamp > $second_timestamp ) { die('Reverse timestamps'); } else { $first_date = getdate( $first_timestamp ); $second_date = getdate( $second_timestamp ); $days_in_between = ($second_date['year']-$first_date['year'])*365 + ($second_date['yday']-$first_date['yday']); } ?> At least, given that every year has 365 days :)

« previous php.notes (#116918) next »