Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-17405

Function phpbb_gmgetdate() returns incorrect result for edge cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3.14-RC1
    • 3.3.13
    • Other
    • None

      There're edge cases when time crosses the threshold of DST transition. In those cases function phpbb_gmgetdate() returns incorrect results, hours returned can be 1 earlier (when DST is +1 increasing) and vice versa.

      Example:

      Antarctica/South_Pole is changed to daylight saving time (DST) at 2:00 AM on Sunday, Sep 29, 2024 local time (making the timezone +13 instead of +12). Now when you use phpbb_gmgetdate() at some point in time earlier than UTC 2:00 AM, Sep 29, 2024, f.e. at 4:00 AM on Sunday, Sep 29, 2024 local Antarctica/South_Pole time, it internally uses getdate(time() - date('Z')), but when it makes this subtraction it gets time earlier than DST transition time point (-13 hours) so it (getdate()) considers DST as not yet applied. Thus it yields incorrect result for UTC date info (1 hour ealier than the real time).

            Marc Marc
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: