note 40314 added to function.mktime

From: Date: Sat, 28 Feb 2004 12:30:32 +0000
Subject: note 40314 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-65931@lists.php.net to get a copy of this message
I find it easiest, if I want to find you how many days there are between two dates to use the following method: $init_day = 1; $init_mth = 1; $init_yr = 2004; $dst_day = 5; $dst_mth = 8; $dst_yr = 2004; //first convert to unix timestamp $init_date = mktime(12,0,0,$init_mth,$init_day,$init_yr); $dst_date = mktime(12,0,0,$init_mth,$init_day,$init_yr); $offset = $dst_date-$init_date; //Depending on which offset type you want, switch order $days = floor($offset/60/60/24); ---- Manual Page -- http://www.php.net/manual/en/function.mktime.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40314 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40314&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40314&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#65931) next »