#38279 [Opn->Bgs]: mktime dont work right on all 31 day of a month
| From: | tony2001@php.net | Date: | Tue, 01 Aug 2006 07:32:35 +0000 |
| Subject: | #38279 [Opn->Bgs]: mktime dont work right on all 31 day of a month | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100167@lists.php.net to get a copy of this message | ||
ID: 38279
Updated by: tony2001@php.net
Reported By: support at ml-networld dot de
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Debian Sarge
PHP Version: 5.1.4
New Comment:
You need to set correct timezone.
Previous Comments:
------------------------------------------------------------------------
[2006-08-01 07:11:19] support at ml-networld dot de
sorry,
i put the wrong phpversion
------------------------------------------------------------------------
[2006-08-01 07:09:09] support at ml-networld dot de
Description:
------------
On the 31 Juli, Oktober, Dezember the code below say that the lastmonth
is the current month. But on the 31 August it say that the last month is
jul. this code is an example code from nuntius on the site
http://de2.php.net/manual/de/function.mktime.php
Reproduce code:
---------------
$dateMinusOneMonth = mktime(0, 0, 0, date("m")-1, date("d"),
date("Y"));
$lastmonth = date("M", $dateMinusOneMonth);
echo $lastmonth;
Expected result:
----------------
on the 31 juli
jun
on the 31 oktober
sep
on the 31 dezember
nov
Actual result:
--------------
on the 31 juli
jul
on the 31 oktober
okt
on the 31 dezember
dez
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38279&edit=1