INFO:
osTicket Version v1.10.4 (035fd0a) — Up to date
Web Server Software Apache
MySQL Version 5.7.25
PHP Version 5.6.38-2+ubuntu16.04.1+deb.sury.org+1

My osTicket system, I believe, has code somewhere that is some how resetting the default timezone when other code is run.

It's strange because the system as of now displays the correct time no issue.

However I have for instance added some code that simply displays some date & time information, nothing more using the PHP " date();" function.

When I run the code on osTicket it displays 8 hours ahead, which I believe is UTC time.

When I run the PHP code directly on the server however it displays the correct UNIX time. So I believe there is some underlying code in my osTicket that is running and resetting the timezone or something.

Because of this I also cannot use the Reports mod by software-mods.

I have no idea how to begin troubleshooting this however. Any ideas would be much appreciated.

    I talked to @scottro about this, and he posted a new version shortly after it was reported. If you use the Reports plugin you can just update to the new version or use the fix he posted here on the forums.

    Seems to not just be limited to his reporting-mod. Even running an "echo date();" in any of the osTicket native PHP files will display incorrect time.

    I only first realized this when installing the Reports mod, as his mod also utilizes php date/time functions and methods.

      ramrajone

      Its definitely a code issue.

      PHP, MySQL, osTicket and System times and time-zones have been verified, re-verified and re-re-verified.

      When I run unix date/time commands always returns the correct time, date and timezone.

      I created a PHP file that just echos the output of date(); and that returns the correct date and time as well on the command-line.

      However if I go into any of the osTicket php files, lets say, "/upload/include/staff/header.inc.php" and just add an "echo date('d/m/Y h:ia')" the page will display time 8 hours ahead.

      On the other hand, I created another PHP file that does the same thing (echo's the date and time) and moved it to the /upload directory; navigate there with my browser, it shows the correct time and date.

      I did the same tests on a new osTicket 11 and 10.5 version servers and those dont have these issues.

      So I wonder if theres something weird about my 10.4 version?

      I'll probably just have to end up migrating or wiping the system and upgrading to 10.5 hoping that whatever code is causing this bug will die in the process.

        Pietro_Aretino
        I have never seen an issue like that, I don't think osTicket has any code to do its own Time or timezone
        Do your tickets show 8 hours difference?

        You can try changing the timezone and see if it's even reading time from your server
        I know one thing someone had reported an issue that they were using custom or advance time settings, make sure your set to Locale Defaults

        Write a Reply...