I moved my OSticket to a new Shared Hosting server in India . when i book a ticket the time recorded in the OSticket is 3:30 hours ahead. The Default Time Zone setting in Osticket preferences is Asia/Dubai . In Php also it is set to Asia/Dubai
in Mysql it is set to IST . Being a shared hosting , can not change the Mysql timezone .
Is there anyway i can manage it from Osticket ? or any option to offset this time difference ?

  • @Arianguy

    You can change these lines to the following:

            elseif ($tz !== 'UTC' && strpos($tz, '/') === false) {
                return 'Asia/Dubai';
                // Attempt to lookup based on the abbreviation
                //if (!($tz = timezone_name_from_abbr($tz)))
                    // Abbreviation doesn't point to anything valid
                    //return $default;
            }

    Keep in mind though that you'll have to re-apply these changes every time you upgrade osTicket.

    Cheers.

@Arianguy

It sounds like your database timezone was different on your last host or when you exported the database you chose to convert all times in UTC. Anyways, it sounds like a discrepancy in timezones when you moved servers as the data was likely stored in one timezone on the old server and this new server uses a different timezone so the times are all borked.

Cheers.

so for getting new tickets correct time what to do ? Mysql Timezone not allowed to change being a shared hosting. The new host mysql is IST. (india)
1). Anything possible to make new ticket get correct Time from within Osticket ?
2). Changing to Hosts GMT based timezone server solve this ?

    @Arianguy

    New Tickets should be correct unless your system is having issues converting the times with the given timezones. I would say it'd be worth at least testing this on a different host where you can set a UTC timezone for the database, etc.

    Cheers.

    Arianguy

    Ah, I actually do see how this can be an issue as we don't allow abbreviations of timezones (ie. IST) so we use PHP's native timezone_name_from_abbr() function to guess the actual timezone name from the abbreviation. This function converts IST to Asia/Jerusalem which has a 2+ hour difference from Asia/Dubai. So to address this you should update your database timezone from an abbreviation to an actual timezone name. Or if you don't want to do all that you can hardcode a specific timezone in the codebase (although I don't know the full affect of this so proceed at your own risk).

    Cheers.

    yeah exactly , and cause of this the new tickets get time as 2+1:30 = 3:30 hours ahead. which file i can hard code this in ? please as hos does not allow to change timezone of Mysql.

    @Arianguy

    You can change these lines to the following:

            elseif ($tz !== 'UTC' && strpos($tz, '/') === false) {
                return 'Asia/Dubai';
                // Attempt to lookup based on the abbreviation
                //if (!($tz = timezone_name_from_abbr($tz)))
                    // Abbreviation doesn't point to anything valid
                    //return $default;
            }

    Keep in mind though that you'll have to re-apply these changes every time you upgrade osTicket.

    Cheers.

      KevinTheJedi Thank you Very Much , This solved the Time Difference.
      I kept it same as the host server "Asia/Kolkata " and the conversion for Dubai users is happening perfectly.

      THANK YOU VERY MUCH and God Bless you !

      Write a Reply...