#43176 [Opn->Bgs]: strtotime('2007-10-28') + 24*3600 returns wrong date

From: Date: Fri, 02 Nov 2007 12:19:01 +0000
Subject: #43176 [Opn->Bgs]: strtotime('2007-10-28') + 24*3600 returns wrong date
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-119243@lists.php.net to get a copy of this message
ID: 43176 Updated by: derick@php.net Reported By: devil1591 at yahoo dot fr -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: windows 2000 PHP Version: 4.4.7 New Comment: We are happy to tell you that you just discovered Daylight Savings Time. For more information see: http://webexhibits.org/daylightsaving/b.html Instead of using mktime/date consider using gmmktime and gmdate which do not suffer from DST. just use strtotime( "2007-10-28 +1 day" ); - that will work fine Previous Comments: ------------------------------------------------------------------------ [2007-11-02 11:35:20] devil1591 at yahoo dot fr Description: ------------ echo date('Y-m-d', strtotime('2007-10-28') + 24*3600); returns 2007-10-28 which is wrong, you need 3600 seconds more to get 2007-10-29 Reproduce code: --------------- echo date('Y-m-d', strtotime('2007-10-28') + 24*3600); Expected result: ---------------- 2007-10-29 Actual result: -------------- 2007-10-28 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43176&edit=1

« previous php.bugs (#119243) next »