note 109889 deleted from function.mktime by danbrown
| From: | danbrown@php.net | Date: | Fri, 31 Aug 2012 15:35:13 +0000 |
| Subject: | note 109889 deleted from function.mktime by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190308@lists.php.net to get a copy of this message | ||
Note Submitter: berga
----
about tothpeter at fbi dot hu 20-Mar-2012 08:52
It happens on Win2003 server too, I think that it happens because '0' makes php thinks
it's and octal, if you remove the '0' before all samples it works, like that:
using on Win2003 with Apache
$a=mktime(0,0,0,7,01,2012);
echo date('Y-m-d',$a); // 2012-07-01
$a=mktime(0,0,0,8,01,2012);
echo date('Y-m-d',$a); // 2011-12-01 WTF
$a=mktime(0,0,0,9,01,2012);
echo date('Y-m-d',$a); // 2011-12-01 WTF
$a=mktime(0,0,0,10,01,2012);
echo date('Y-m-d',$a); // 2012-10-01
$a=mktime(0,0,0,07,31,2012);
echo date('Y-m-d',$a); // 2012-07-31
Output:
2012-07-01
2012-08-01
2012-09-01
2012-10-01
2012-07-31