note 87934 added to function.strtotime
| From: | vgr at edainworks dot com | Date: | Wed, 31 Dec 2008 11:15:00 +0000 |
| Subject: | note 87934 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148714@lists.php.net to get a copy of this message | ||
found a strange behaviour, maybe this note will save someone else's time.
We are the 31st Dec. 2008 and my time is roughly 11:56 GMT+1 (this is not 4 minutes to midnight ;-)
So date('M') returns 'Dec', of course.
Nos the strange strtotime() behaviour :
date('M',strtotime('-1 month'));
produces wrong 'Dec'
date('M',strtotime('-31 day'));
produces correct 'Nov'
strange, no ? I checked the differences (in days) between the two strtotime values 'today'
and '-1 month' : 29,50 days ; this should be 30.43 (the mean duration of a month, AFAIK)
----
Server IP: 89.31.146.176
Probable Submitter: 82.243.20.181
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- https://master.php.net/note/edit/87934
Del: integrated -- https://master.php.net/note/delete/87934/integrated
Del: useless -- https://master.php.net/note/delete/87934/useless
Del: bad code -- https://master.php.net/note/delete/87934/bad+code
Del: spam -- https://master.php.net/note/delete/87934/spam
Del: non-english -- https://master.php.net/note/delete/87934/non-english
Del: in docs -- https://master.php.net/note/delete/87934/in+docs
Del: other reasons-- https://master.php.net/note/delete/87934
Reject -- https://master.php.net/note/reject/87934
Search -- https://master.php.net/manage/user-notes.php