Doc #51560 [Fbk->NoF]: strtotime not working in certain cases
| From: | frozenfire@php.net | Date: | Sun, 04 Dec 2011 02:49:12 +0000 |
| Subject: | Doc #51560 [Fbk->NoF]: strtotime not working in certain cases | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7541@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51560&edit=1
ID: 51560
Updated by: frozenfire@php.net
Reported by: attand at gmail dot com
Summary: strtotime not working in certain cases
-Status: Feedback
+Status: No Feedback
Type: Documentation Problem
Package: *General Issues
Operating System: linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2010-04-15 12:50:33] derick@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
Not sure what you're doing here, but the script works perfectly fine here:
derick@kossu:/tmp$ cat bug51560.phpt
--FILE--
<?php
echo date_default_timezone_get(), "\n";
echo phpversion(), "\n";
$maxDate = mktime(0, 0, 0, 12, 1, 2009);
var_dump( $maxDate );
echo date( DateTime::RFC2822 . ' e', $maxDate ), "\n";
$newDate = strtotime("-1 months", $maxDate);
var_dump( $newDate );
echo date( DateTime::RFC2822 . ' e', $newDate ), "\n";
echo date( 'Y-m-d', $newDate ), "\n";
?>
derick@kossu:/tmp$ php bug51560.phpt
--FILE--
Europe/London
5.3.3-dev
int(1259625600)
Tue, 01 Dec 2009 00:00:00 +0000 Europe/London
int(1257033600)
Sun, 01 Nov 2009 00:00:00 +0000 Europe/London
2009-11-01
------------------------------------------------------------------------
[2010-04-15 12:29:57] attand at gmail dot com
Description:
------------
$maxDate = mktime(0, 0, 0, 12, 1, 2009) ;
print date("Y-m-d", strtotime("-1 months", $maxDate)) ;
returns "2009-12-01"
Expected result:
----------------
My understanding is that it should return "2009-11-30"
Besides where can i find the list of str parameter to be used in strtotime(str $time,int $now)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=51560&edit=1