Edit report at https://bugs.php.net/bug.php?id=64401&edit=1
ID: 64401 Updated by: [email protected] Reported by: mohsen dot taheri at gmail dot com Summary: 21 March 2012 Strange result -Status: Open +Status: Not a bug Type: Bug Package: Date/time related Operating System: Ubuntu PHP Version: 5.3Git-2013-03-10 (Git) Block user comment: N Private report: N New Comment: Right, so your result is correct. In 2012 Daylight Savings Time started Midnight between Tuesday, March 20 and Wednesday, March 21 where the clocks were set ahead by 1 hour. That means that 1 second after midnight became 1 second after 1am exactly as you are seeing. So there was never a 2012-03-21 00:00:01. Previous Comments: ------------------------------------------------------------------------ [2013-03-12 06:23:39] mohsen dot taheri at gmail dot com I use date_default_timezone_set("Asia/Tehran"); 2012-03-21 is the second day of year in Tehran timezone !!! ------------------------------------------------------------------------ [2013-03-11 12:24:48] [email protected] Which timezone? You probably discovered DST in your timezone. ------------------------------------------------------------------------ [2013-03-11 07:29:36] mohsen dot taheri at gmail dot com Description: ------------ strtotime("2012-03-21 00:00:01") return value is the same as strtotime("2012-03-21 01:00:01") both of the are 1332276001 this problem range is 2012-03-21 00:00:00 to 2012-03-21 01:00:00 I don't face this problem in any other dates Test script: --------------- echo date("Y-m-d H:i:s", strtotime("2012-03-21 00:00:01"))."\n"; echo date("Y-m-d H:i:s", strtotime("2012-03-21 01:00:01"))."\n"; Expected result: ---------------- 2012-03-21 00:00:01 2012-03-21 01:00:01 Actual result: -------------- 2012-03-21 01:00:01 2012-03-21 01:00:01 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64401&edit=1
