-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
3.3.3
-
None
Hello!
Unfortunately, $this->user->format_date does not respond correctly to all timestamps.
I created two example timestamps (2021-03-28 00:00 - 1616886000 and 2021-03-31 23:59 - 1617231540).
The
$this->user->format_date(1616886000, 'Y-m-d H: i', true); |
return correct value :: 2021-03-28 00:00
The
$this->user->format_date(1617231540, 'Y-m-d H: i', true); |
return incorrect value :: 2021-04-01 00:59
If I subtract the timestamps from the other 1617231540 - 1616886000 = 345540/60 = 5759 min = 3 days 23 hours and 59 minutes
2021-03-28 00:00 + 3 days 23 hours and 59 minutes = 2021-03-31 23:59
So 2021-04-01 00:59 is a really wrong value.
If use the
date('Y-m-d H: i', 1617231540 + $this->user->timezone->getOffset(new \ DateTime)); |
then add back display correct date 2021-03-31 23:59
So only the $this->user->format_date function is faulty.
My PHP 7.4 and phpBB 3.3.3 setting: Europe/Budapest
I would ask you to investigate this, thank you in advance.