Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-16715

user time zone bug

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.3.3
    • Fix Version/s: None
    • Component/s: Build System
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            KillBill. KillBill.
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: