note 54797 added to function.strtotime
| From: | dcahhNOSPAM at gmx dot de | Date: | Fri, 15 Jul 2005 09:21:44 +0000 |
| Subject: | note 54797 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92013@lists.php.net to get a copy of this message | ||
Maybe it saves others from troubles:
if you create a date (i.e. a certain day, like 30.03.2005, for a calendar for example) for which you
do not consider the time, when using mktime be sure to set the time of the day to noon:
<?php
$iTimeStamp = mktime(12, 0, 0, $iMonth, $iDay, $iYear);
?>
Otherwhise
<?php
// For example
strtotime('-1 month', $iTimeStamp);
?>
will cause troubles when calculating the relative time. It often is one day or even one month off...
After I set the time to noon "strtotime" calculates as expected.
Cheers
Denis
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54797
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54797&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54797&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54797&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54797&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54797&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54797&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54797&report=yes
Search -- http://master.php.net/manage/user-notes.php