mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Make sure we anchor this test to February
This commit is contained in:
parent
29333550d2
commit
61e9b7354f
@ -7,8 +7,8 @@ In the "verbose setup method" I'm trying setup the DateTime object myself
|
||||
to see if it's the format string which is parsed in correctly or if it's the DateTime
|
||||
object which is breaking stuff. From the testing it appears DateTime is broken somehow.
|
||||
*/
|
||||
$ss = 'first day of March midnight';
|
||||
$es = 'first day of April midnight - 1 second';
|
||||
$ss = 'february first day of last month midnight';
|
||||
$es = 'february first day of this month midnight - 1 second';
|
||||
|
||||
$s = new DateTime($ss);
|
||||
$e = new DateTime($es);
|
||||
@ -50,7 +50,7 @@ effect on the results of the diff. By modifying the datetime with ->modify every
|
||||
it just means you have to be careful of how we work with DateTimes .
|
||||
*/
|
||||
$s = new DateTime($ss);
|
||||
$e = new DateTime('first day of April midnight');
|
||||
$e = new DateTime('february first day of this month midnight');
|
||||
$e->modify('- 1 second');
|
||||
var_dump($e->diff($s)->days); // 30 ... and should be 30
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user