Bug #81093 [Nab]: different time give same date

From: Date: Mon, 31 May 2021 22:12:49 +0000
Subject: Bug #81093 [Nab]: different time give same date
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234131@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81093&edit=1 ID: 81093 User updated by: sylvain dot rochette at gmail dot com Reported by: sylvain dot rochette at gmail dot com Summary: different time give same date Status: Not a bug Type: Bug Package: *General Issues Operating System: linux PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I try the sandbox and it work, it seam my 5.6.35 php is buggy on my domain. Not quite sure of the issue... Previous Comments: ------------------------------------------------------------------------ [2021-05-31 22:03:05] requinix@php.net 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. ------------------------------------------------------------------------ [2021-05-31 22:01:28] sylvain dot rochette at gmail dot com Description: ------------ php5.7, i cannot use a recent version but I think this issue is still there The problem that I don't understand is a date come 2 times, with different time value. EXACT SAME TIME for about 1h in total The example I give start at 2020-11-01 00:45:00 1604205900 2020-11-01 00:50:00 1604206200 2020-11-01 00:55:00 1604206500 2020-11-01 01:00:00 1604206800 but after few 5 min jump (300) it return back to 2020-11-01 01:00:00 1604210400 even if the time is different, I just don't understand, if you continue it will get to 2 hours and it's fine but just this sequence does not work. I try the first 11 months without any issue until I get to this date!! The only thing I see is they are big number but still it continue fine, The thing is, php seam to have a bug (hardcoded) related to this date, I say PHP it's maybe linux, I just don't understand it... My concern is date >= then 1604210400 are all BAD... Please help me to understand the issue I am stuck with that lol, a bug from date("Y-m-d H:i:s", $i)??? Test script: --------------- for ($i = 1604205900; $i <= 1604211000; $i += 300) { $time = date("Y-m-d H:i:s", $i); echo ($time." ".$i."<BR/>"); } Expected result: ---------------- 2020-11-01 00:45:00 1604205900 2020-11-01 00:50:00 1604206200 2020-11-01 00:55:00 1604206500 2020-11-01 01:00:00 1604206800 2020-11-01 01:05:00 1604207100 2020-11-01 01:10:00 1604207400 2020-11-01 01:15:00 1604207700 2020-11-01 01:20:00 1604208000 2020-11-01 01:25:00 1604208300 2020-11-01 01:30:00 1604208600 2020-11-01 01:35:00 1604208900 2020-11-01 01:40:00 1604209200 2020-11-01 01:45:00 1604209500 2020-11-01 01:50:00 1604209800 2020-11-01 01:55:00 1604210100 2020-11-01 02:00:00 1604210400 2020-11-01 02:05:00 1604210700 2020-11-01 02:10:00 1604211000 Actual result: -------------- 2020-11-01 00:45:00 1604205900 2020-11-01 00:50:00 1604206200 2020-11-01 00:55:00 1604206500 2020-11-01 01:00:00 1604206800 2020-11-01 01:05:00 1604207100 2020-11-01 01:10:00 1604207400 2020-11-01 01:15:00 1604207700 2020-11-01 01:20:00 1604208000 2020-11-01 01:25:00 1604208300 2020-11-01 01:30:00 1604208600 2020-11-01 01:35:00 1604208900 2020-11-01 01:40:00 1604209200 2020-11-01 01:45:00 1604209500 2020-11-01 01:50:00 1604209800 2020-11-01 01:55:00 1604210100 2020-11-01 01:00:00 1604210400 2020-11-01 01:05:00 1604210700 2020-11-01 01:10:00 1604211000 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81093&edit=1

« previous php.bugs (#234131) next »