Bug #67993 [Opn]: wrong day addition

From: Date: Wed, 10 Sep 2014 13:58:56 +0000
Subject: Bug #67993 [Opn]: wrong day addition
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187496@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
 User updated by:    luke at woollysheep dot net
 Reported by:        luke at woollysheep dot net
-Summary:            wrong day addiction
+Summary:            wrong day addition
 Status:             Open
 Type:               Bug
 Package:            Date/time related
 Operating System:   Slackware
 PHP Version:        5.6.0
 Block user comment: N
 Private report:     N

 New Comment:

some correction


Previous Comments:
------------------------------------------------------------------------
[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 (#187496) next »