Edit report at http://bugs.php.net/bug.php?id=51560&edit=1

 ID:               51560
 Updated by:       der...@php.net
 Reported by:      attand at gmail dot com
 Summary:          strtotime not working in certain cases
-Status:           Open
+Status:           Feedback
 Type:             Documentation Problem
 Package:          *General Issues
 Operating System: linux
 PHP Version:      Irrelevant

 New Comment:

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:



der...@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";

?>

der...@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


Previous Comments:
------------------------------------------------------------------------
[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 http://bugs.php.net/bug.php?id=51560&edit=1

Reply via email to