note 34852 added to function.mktime
| From: | carinato at tin dot it | Date: | Fri, 08 Aug 2003 14:17:07 +0000 |
| Subject: | note 34852 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53649@lists.php.net to get a copy of this message | ||
After a day of tests, I have found my script error:
I must do a date difference using a simple calculation:
$diff_date_days = ($timestamp_2 - timestamp_1) / 86400;
this is ok but the $timestamps must be calculated with:
$timestamp = gmmktime(0,0,0,$month,$day,$year) or
$timestamp = mktime(0,0,0,$month,$day,$year,0) or
$timestamp = mktime(0,0,0,$month,$day,$year,1)
but not with:
$timestamp = mktime(0,0,0,$month,$day,$year) !!!!!
infact the daylight savings time can change !!
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34852
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34852&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34852&report=yes