Bug #67993 [Opn->Dup]: wrong day addition

From: Date: Sun, 30 Sep 2018 14:04:48 +0000
Subject: Bug #67993 [Opn->Dup]: wrong day addition
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217311@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
 Updated by:         cmb@php.net
 Reported by:        luke at woollysheep dot net
 Summary:            wrong day addition
-Status:             Open
+Status:             Duplicate
 Type:               Bug
 Package:            Date/time related
 Operating System:   Slackware
 PHP Version:        5.6.0
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Closing as duplicate of bug #69205.  See also <https://3v4l.org/0GAPu>.


Previous Comments:
------------------------------------------------------------------------
[2015-03-09 15:38:35] nd dot wortel at gmail dot com

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

------------------------------------------------------------------------
[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 (#217311) next »