Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Time showing up incorrectly on settings

In two of my systems, development and production, the time shows up incorrectly on the settings page. Using v1.9.8.1 (4752178) in testing, and v1.9.12 (19292ad) in production. When I go to Settings>System, the time is incorrect. I am in MST, but the time shows up 7 hours ahead of my time. Changing the time zone field yields no changes in either system. My OS is set up with the right time zone. I set the time zone in PHP.ini and still nothing changed.

Interestingly enough, when someone submits a ticket the date and time is correct. The problem is when someone goes to register as a new client then they see the current time in the text.

Observe daylight saving (Current Time: 11/18/2015 10:23 pm)

Really, the time should say 3:23pm.

Comments

  • Thank you, that looks like it is my issue. Following your directions in https://github.com/osTicket/osTicket-1.8/issues/2330#issuecomment-126336297 I found that:

    1) My default timezone and daylight savings time is set appropriately.
    2) Each users timezone and daylight savings time is set appropriately.
    3) My php.ini is configured with:
        date.timezone = America/Denver
    4) I enabled PHP intl with the following
        sudo apt-get install php5-intl
        sudo php5enmod intl

    I rebooted my server after installing and enabling PHP intl. I ran the command:
        php -m
    to verify that intl is installed and enabled and it was.

    Still, nothing changes on the Agent panel -> Settings -> System page.
    However, the time when it shows up in each agent's account page is correct!
    The only two places that I have found where the time is incorrect is on the client registration page and on the Settings -> System page.

    Further advice?
  • The time on those pages is always wrong since it's displaying not the current time - instead it shows UTC or whatever time and is more an example how the configured values (e.g. YYYY-MM-DD @ HH:ii:ss) will then later look (e.g. 2015-11-19 @ 17:09:33)
  • Chefkeks, that may be acceptable for a sysadmin. But when a user logs in and sees this, I should try to fix it.
    osticketregtimeproblem.png
    806 x 539 - 60K
  • Then you'd need to change the source code to show the current time as example instead of UTC or what ever time is shown there.
  • I'd like to, but PHP isn't up my alley. The developers are using different calls to get the time. Here is a screenshot of a staff member's settings in the agent's tab. Clearly this page is making the correct call to grab the time and my previous screenshot demonstrates a page where the call was being made incorrectly. If I've identified a minor bug, I'd like to be redirected to a bug tracker where I can submit my request.
    osticketregtimenoproblemstaff.png
    940 x 317 - 59K
  • So ummm it cannot display the correct time on the create account page... as the person viewing it does not have a timezone yet.
  • Alright, I see where you both are coming from. You convinced me to write a test. When I wrote the following php file:
        <?php
        echo(date(h:i A));
        ?>
    I placed the file in /var/www/html and when I requested it with my browser it returned the correct time. Clearly, every time that a timestamp is shown it is dynamic. Every page I have posted changes the time every minute, the time is generated on the fly. Some pages make the correct calls, others do not. There is indeed a discrepancy between some pages in how the time is interpreted and displayed.
Sign In or Register to comment.