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

When setting the board's date format the board's timezone settings aren't taken into account

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.7-PL1
    • Fix Version/s: 3.0.8-RC1
    • Component/s: ACP
    • Labels:
      None

      Description

      The "Date format" selection entry in the "Board Settings" is supposed to display its options according to the board's time zone. It does not however because there is a small coding oversight:

      OPEN includes/acp/acp_board.php

      FIND

      		$user->timezone = $config['board_timezone'];
      		$user->dst = $config['board_dst'];

      REPLACE WITH

      		$user->timezone = $config['board_timezone'] * 3600;
      		$user->dst = $config['board_dst'] * 3600;

        Issue Links

          Activity

          Hide
          narqelion narqelion [X] (Inactive) added a comment -

          Devils Advocate: What is the downside to the date format field always returning the ZULU offset from server time in that particular ACP screen? To be honest, it comes in quite handy when troubleshooting time discrepancies as it is the fastest way for a phpBB admin (especially in paid hosting) to find out their server time if is is not set correctly to ZULU. If you do change the current ACP behavior to dynamically update the date format field to reflect changes to the board timezone field I think you should add a field that does what the ACP date format field currently does, display ZULU.

          Show
          narqelion narqelion [X] (Inactive) added a comment - Devils Advocate: What is the downside to the date format field always returning the ZULU offset from server time in that particular ACP screen? To be honest, it comes in quite handy when troubleshooting time discrepancies as it is the fastest way for a phpBB admin (especially in paid hosting) to find out their server time if is is not set correctly to ZULU. If you do change the current ACP behavior to dynamically update the date format field to reflect changes to the board timezone field I think you should add a field that does what the ACP date format field currently does, display ZULU.
          Hide
          MartectX MartectX [X] (Inactive) added a comment -

          nargelion:

          What is the downside to the date format field always returning the ZULU offset from server time in that particular ACP screen?


          In short: There is none. But from the code it becomes clear that the developers intended to show the options according to the board time zone:

          	function dateformat_select($value, $key)
          	{
          		global $user, $config;
           
          		// Let the format_date function operate with the acp values

          Show
          MartectX MartectX [X] (Inactive) added a comment - nargelion: What is the downside to the date format field always returning the ZULU offset from server time in that particular ACP screen? In short: There is none. But from the code it becomes clear that the developers intended to show the options according to the board time zone: function dateformat_select($value, $key) { global $user, $config;   // Let the format_date function operate with the acp values
          Hide
          narqelion narqelion [X] (Inactive) added a comment -

          MartectX:

          In short: There is none.

          Yeah, I couldn't come up with anything either. There is no indication in the ACP UI that it should change dynamically, so bug or unintended feature? Sometimes the best features are accidents.

          Show
          narqelion narqelion [X] (Inactive) added a comment - MartectX: In short: There is none. Yeah, I couldn't come up with anything either. There is no indication in the ACP UI that it should change dynamically, so bug or unintended feature? Sometimes the best features are accidents.
          Hide
          narqelion narqelion [X] (Inactive) added a comment -

          Apparently you cannot vote on "Resolved" issues, thus my -1 this is a stupid idea vote didn't get counted. Also, the changelog entry description is completely wrong with regard to the behavior that actually changes. Correctly take admin's timezone settings into account when setting board date format. Wrong, the admin's timezone (controlled by UCP setting) has nothing to do with this, it is the system timezone setting in the ACP you are now using to populate the date format field value.

          Show
          narqelion narqelion [X] (Inactive) added a comment - Apparently you cannot vote on "Resolved" issues, thus my -1 this is a stupid idea vote didn't get counted. Also, the changelog entry description is completely wrong with regard to the behavior that actually changes. Correctly take admin's timezone settings into account when setting board date format. Wrong, the admin's timezone (controlled by UCP setting) has nothing to do with this, it is the system timezone setting in the ACP you are now using to populate the date format field value.
          Hide
          bantu Andreas Fischer added a comment -

          I corrected the changelog and the commit message. Thanks for noting.

          If you need the ability to diplay the "ZULU time" open a new ticket with the suggestion to put it somewhere and have people vote on it.

          The code as it is right now without my patch is certainly wrong as it will add the DST and timezone settings as seconds, which can lead to unexpected results when a date format also shows seconds.

          Show
          bantu Andreas Fischer added a comment - I corrected the changelog and the commit message. Thanks for noting. If you need the ability to diplay the "ZULU time" open a new ticket with the suggestion to put it somewhere and have people vote on it. The code as it is right now without my patch is certainly wrong as it will add the DST and timezone settings as seconds, which can lead to unexpected results when a date format also shows seconds.

            People

            • Assignee:
              bantu Andreas Fischer
              Reporter:
              MartectX MartectX [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development