i've looked over the different timestamp posts here and haven't found a solution that will work yet.
Because we're on a shared SiteGround server i don't have "full control" of variables.

And, to see if it might be a SiteGround issue, i installed a fresh 1.18.1 on a different local-domain.
No issues with that one's timestamps.

PHP's "date.timezone" is 'DEFAULT'
MySQL's "system time zone" is 'UTC'
MySQL's "timezone" is "America/Chicago" with a time zone (session value) of 'UTC'
MySQL's "session track system variables" contains 'time_zone'
OST's "Default Time Zone" is 'America / New_York'

This does NOT result in a correct timestamp -- a posting of 12:05PM yields 05:05PM ( a +5 difference).
They are claiming this is a 'default' setting for their shared environment.
And ask that i go to the 'developers' to have them comment.

Any thoughts?

ADVthanksANCE,
miC

  • KevinTheJedi replied to this.
  • _SAmiC

    Ah, so the way your system is setup (and since you can't change it) you should look here and use the highlighted line. Comment out the lines above it so it always uses the @@global.system_time_zone variable in your system. Then set your system and profile timezones back to normal and everything should be good.

    function db_timezone() {
        //$timezone = db_get_variable('time_zone', 'global');
        //if ($timezone == 'SYSTEM')
            $timezone = db_get_variable('system_time_zone', 'global');
    
        return $timezone;
    }

    Cheers.

    _SAmiC

    What do the dates/times show in the database? Are they reflecting UTC or America/Chicago?

    Cheers.

    @@global.time_zone
    America/Chicago

    @@session.time_zone
    UTC

    from select @@global.time_zone, @@session.time_zone;

    _SAmiC

    Please look at an example date/time in the osTicket database specifically and see if it reflecting Chicago or UTC.

    Cheers.

    I'll try to get to that now.
    I'm IN the osTicket database when i do the above SQL queries, am i not?
    So, if my wall-clock shows 1500 and the osTicket timestamp shows 2000 it seems to be neither right?

    I'm sorry to be confused here, i'm reporting the values i see and trying not to interpret them.
    Does that timestamp difference show that osT is displaying CDT or UTC?
    It is a 5 hour difference but neither, isn't it?

    Best,
    michael grimes

    yes, good post - i previously reported the settings i found ...

    PHP's "date.timezone" is 'DEFAULT'
    MySQL's "system time zone" is 'UTC'
    MySQL's "timezone" is "America/Chicago" with a time zone (session value) of 'UTC'
    MySQL's "session track system variables" contains 'time_zone'
    OST's "Default Time Zone" is 'America / New_York'

    Because this is a shared host, on SiteGround, i don't have 'full control' and can't do many of the things in that post.

    Thanks for the comment though - if i knew what was wrong i wouldn't be here ;-)

    miC

      _SAmiC

      Let me provide clearer steps I guess. Please go to the _ticket table in your osTicket database, find a ticket where you know what time it was created (or simply create a new one and write down the time you created it), and look at the created column value for that specific ticket record to see what it says. See if it matches the time you wrote down or if it is 5 hours behind/ahead. This will help us understand what time the database is using so we can better understand what’s happening.

      Cheers.

      and the 'updated' value which should match my initial snip of the ticket is

      _SAmiC

      So it’s showing a created time of 16:05 in the db, showing 17:05 in the UI, and the UI should be showing 12:05?

      Cheers.

      9 days later

      Sorry for delay in responding -- other issues took precedence.
      Yes, you've summarized the issue.

      Any idea what could be going on?
      Have i configured something incorrectly?

      Best,
      miC

        _SAmiC

        Maybe your system time zone or maybe profile time zone is off? Db should be UTC so UI is an hour ahead means the time zone in the UI (ie. user/system time zone) is most likely wrong.

        Cheers.

        @KevinTheJedi
        sorry to add yet another post -- here is the current status -- no change yet and SiteGround has closed their ticket saying nothing is wrong with their settings for PHP or MySQL on their end.

        notes-2024-1108-timezone-issue-after-ost-upgrade-to-v181.pdf
        126kB

        my next attempt to fix this will be making some osT timezone setting changes to see if we can see differences in the values being displayed.

        miC

        @KevinTheJedi

        You're busy with more important things, so no worries on this i guess?
        The best i could come up with is to believe that something is wrong with SiteGround's MySQL cofiguration.

        So, i've set osT system TZ to be America/Chicago which matches SiteGrounds's MySQL "timezone" variable.
        Then set my ost profile TZ to be America/New_York.

        The seemingly bizarre result to me is that the ost Ticket display values now show UTC timestamp.
        While this is not ideal, at least it seems consistent from ticket to ticket.

        For now i think i'm done fiddling.
        I'd rather you were able to work on V2 of osTicket which all of us anxiously await!

        Again, thanks for all your attention to this issue.

        Best regards,
        michael grimes

          _SAmiC

          Ah, so the way your system is setup (and since you can't change it) you should look here and use the highlighted line. Comment out the lines above it so it always uses the @@global.system_time_zone variable in your system. Then set your system and profile timezones back to normal and everything should be good.

          function db_timezone() {
              //$timezone = db_get_variable('time_zone', 'global');
              //if ($timezone == 'SYSTEM')
                  $timezone = db_get_variable('system_time_zone', 'global');
          
              return $timezone;
          }

          Cheers.

          Write a Reply...