Bug #67993 [Com]: wrong day addition

From: Date: Mon, 09 Mar 2015 15:38:36 +0000
Subject: Bug #67993 [Com]: wrong day addition
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191268@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67993&edit=1

 ID:                 67993
 Comment by:         nd dot wortel at gmail dot com
 Reported by:        luke at woollysheep dot net
 Summary:            wrong day addition
 Status:             Assigned
 Type:               Bug
 Package:            Date/time related
 Operating System:   Slackware
 PHP Version:        5.6.0
 Assigned To:        derick
 Block user comment: N
 Private report:     N

 New Comment:

There seems to be a bug with DateTime objects for December 31st, every 400 years starting 2369. See
https://bugs.php.net/bug.php?id=69205


Previous Comments:
------------------------------------------------------------------------
[2014-09-10 13:58:56] luke at woollysheep dot net

some correction

------------------------------------------------------------------------
[2014-09-10 08:24:32] luke at woollysheep dot net

Description:
------------
adding P1D to 2369-12-30 00:00:00 the result is 2370-01-00
really strange day :oD

Test script:
---------------
---
From manual page: http://www.php.net/datetime.add
---

$a = new DateTime("2369-12-30 00:00:00");
$a->add(new DateInterval('P1D'));
var_dump($a);

will print

class DateTime#3 (3) {
  public $date =>
  string(26) "2370-01-00 00:00:00.000000"
  public $timezone_type =>
  int(3)
  public $timezone =>
  string(11) "Europe/Rome"
}



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=67993&edit=1


Thread (5 messages)

« previous php.bugs (#191268) next »