note 87934 rejected from function.strtotime by danbrown

From: Date: Wed, 31 Dec 2008 18:55:08 +0000
Subject: note 87934 rejected from function.strtotime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-148724@lists.php.net to get a copy of this message
Note Submitter: vgr at edainworks dot com ---- 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)

« previous php.notes (#148724) next »