Hi,

We are using OsTicket 1.15.2 with following setup.

osTicket Version - v1.15.2 (cb6766e)
Web Server - Apache/2.4.48 (Ubuntu)
MySQL Version - 8.0.25
PHP Version - 7.2.34-23+ubuntu20.04.1+deb.sury.org+1

There is a problem with the date display in a ticket thread. Our timezone is Asia/Kolkata (UTC +5:30). A ticket was posted at 12:19 PM on 16th Sept., and then transferred to another agent. The time displayed in the transfer portion of the thread shows 2:11 PM which is 1 hr and 40 minutes ahead.

The time problem occurs when we 'transfer' a ticket to some other agent. We have not seen this problem in a normal thread although I need to check thoroughly. The system setup and the problem thread screenshots are attached.

Regards,

Anand

@Arao

Asia/Kolkata is a notoriously bad timezone in osTicket (especially during daylight savings). You can either modify the code to hardcode the timezone or use a timezone that's in the same offset.

Cheers.

@KevinTheJedi,

Thanks for your response. Could you please point me to the appropriate code segment / file name?

Regards,
Anand

Have you checked for the Time-Zone on the Ubuntu Server, that your osTicket instance runs on ?

Yes.
$ more /etc/timezone
Asia/Kolkata

What is value for date.timezon, under System Information -> PHP Settings,

...also, does this come-up, when transferring the ticket ONLY to a particular agent, or with all other Agent too ?

You can also check for Time Zone under Profile for the Agent(s)

  • Arao replied to this.
    4 days later

    @FunkFuMaster

    Thanks for your message and sorry about the delayed reply. The timezone info in PHP section shows me a warning.

    Should I change the php.ini in /etc/php/7.2/apache?

    date.timezone = Asia/Kolkata

    FunkFuMaster

    The problem surfaces in transfers for any agent. The timezone info / profile setting for the agent is,

    We noticed that the agent's timezone was set to system default and changed it to Asia/Kolkata. We then did a quick test by replying to the same ticket. This time the clock has gone forward by 2 hours and 30 mins.

    Thanks,
    Anand

      Arao
      After having the timezone setting in php.ini, have you restarted the webserver?
      You should not see a warning if the setting is taken effect

      @ramrajone

      Thanks. I haven't made any changes or restarted Apache as I was awaiting confirmation if that is the right change to make. There are 3 php.ini files in various directories under /etc/php/7.2

      I am not sure if there is only one change or multiple changes.

      Regards,
      Anand

        @ramrajone

        Thanks for your reply. After your earlier comment, I did end up adding the timezone info to all the php.ini files. Restarted Apache2 but there is no change. The time is off by 2.30 hours.

        I also checked the link you provided and here is the output.

        +--------------------+---------------------+
        | @@GLOBAL.time_zone | @@SESSION.time_zone |
        +--------------------+---------------------+
        | SYSTEM             | SYSTEM              |
        +--------------------+---------------------+
        1 row in set (0.00 sec)
        +------------------+--------+
        | Variable_name    | Value  |
        +------------------+--------+
        | system_time_zone | IST    |
        | time_zone        | SYSTEM |
        +------------------+--------+

        Ubuntu tzdata,

        Local time is now:      Sunday 26 September 2021 07:29:23 AM IST.
        Universal Time is now:  Sun Sep 26 01:59:23 UTC 2021.

        I don't see anything out of the way.

        Hi,

        I found a workaround solution by switching to a timezone with a different offset. The new value I used in all the 3 php.ini files is,

        date.timezone = Asia/Beirut

        Additionally, I changed the system settings in OST Configuration and also changed the profile settings for a couple of users by setting timezone to Asia/Beirut. Restarted Apache and it now shows the correct time as per my locale.

        @ntozier - Please pass on if you think its ok.

        Thanks,
        Anand

        4 months later

        Hi Anand,

        I'm also facing the same issue. Can you help me.

        • Arao replied to this.

          Hi Anuj ,

          You can try using Afghanistan timezone or something closer. We are still facing the same problem, so there is no workaround. It seems work sometimes but breaks too.

          Regards,
          Anand

          8 days later

          I'm on America/New York time, but have the same issue on each installation. Here is the fix that has worked for me for every version:

          Edit mysqli.php file, which is in /public_html/support/include/mysqli.php

          » CHANGE FROM
          return db_get_variable('system_time_zone', 'global');

          » CHANGE TO
          return db_get_variable('time_zone', 'global');

          Hi @jeunefemme

          Thanks for the fix. I will surely try this and get back to you.

          Regards,
          Anand

          Hi @jeunefemme

          The fix didn't help and the timing is still off. Timezone setting on the PC as well as the Agents' are correct.

          Regards,
          Anand

          2 months later

          I guess it's because your issue has a different cause. My issue was caused by Daylight Savings Time.

          There's a workaround. You can have all agents change the time settings to "Relative Time." The setting is in their profiles.

          Write a Reply...