Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63437

Checks timestamps sent in local timezone instead of UTC

XMLWordPrintable

      According to Gerrit REST API protocol, timestamps are in UTC.

      In America/New_York timezone for example, if the check starts at 13:00, it sends the timestamp to Gerrit as "<date> 13:00:00", which Gerrit interprets as UTC. It should be sending "17:00" in UTC, so that the web UI displays it in the correct local timezone. Instead, I see "9:00 AM" when it should be "1:00 PM".

      I think it might be because the plugin is using java.sql.Timestamp, which subclasses java.util.Date, which tries to recalculate the timestamp with local timezone taken into account in normalize(). I haven't dug into it yet.

      Jenkins, Gerrit, and local workstation are all in America/New_York timezone. Gerrit reports correct timezones in the Comments section, and also in the log files. Jenkins reports the correct timezones as well. The only part that's wrong is the Checks panel's timestamps.

      Looking at the REST API responses in the Chrome console, I see that comments are coming back in UTC (i.e., "17:00" UTC for 1PM local time); but the Checks REST API responses are showing timestamps with local time presentation, when they should be UTC times. That is what causes the UI to show the times as 9AM instead of 1PM.

            lucamilanesio Luca Domenico Milanesio
            jhansche Joe Hansche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: