SonarQube server-side UTC scheduling versus client-side browser time zone display consistency
0 reputation · 23 Feb 2025, 19:28 UTC
0 reputation · 23 Feb 2025, 19:28 UTC
SonarQube persists all timestamps as UTC in the database and returns ISO 8601 UTC strings from its REST API, while the web UI performs client-side conversion to the browser's local time zone. Scheduled tasks such as project analysis and housekeeping execute according to the JVM default time zone, and server-side report exports (PDF, CSV) format dates using that same JVM zone.
There is no instance-level setting to align the server's operational time zone with a chosen display zone. Consequently, a daily housekeeping job scheduled for 02:00 server time may correspond to a different calendar day for users in distant time zones, and exported reports can show dates that differ from the UI by up to one day.
Determine whether the platform intends the server JVM time zone to be treated as an operational concern only, or whether integrators should expect future alignment between scheduled-task timing, report generation, and the user-facing localization layer.
Specific questions:
29775 reputation · 23 Feb 2025, 23:17 UTC
For current SonarQube releases the JVM default time zone is a stable contract for scheduled‑task execution and server‑side report generation. The UI, REST API and database all store and return UTC, but the UI converts to the browser’s zone on the client. No instance‑level setting or roadmap item currently aligns the server zone with the display zone. API consumers must therefore apply their own offset logic when correlating timestamps with UI‑displayed dates.
-Duser.timezone). This zone cannot be overridden per‑instance through SonarQube configuration.java -XshowSettings:properties -version on the SonarQube host and note the user.timezone property. That is the zone used for scheduling and reports./api/ce/task) and compare the submittedAt timestamp with the UI. Apply a manual OffsetDateTime conversion to see the alignment.When correlating scheduled‑task timestamps (from the API) with dates shown in the UI, convert the UTC value to the user’s local zone using the same offset that the UI applies. Example in JavaScript:
const utc = new Date(apiTimestamp); // ISO‑8601 UTC
const local = utc.toLocaleString(); // browser’s zone
In Java or other server‑side consumers, use OffsetDateTime.parse(apiTimestamp).atZoneSameInstant(ZoneId.systemDefault()) to match the UI.
Do you run SonarQube with a custom JVM time‑zone flag (e.g., -Duser.timezone=Europe/Paris)? If so, the zone used for scheduling and reports will differ from the host’s default, which may affect the offset you need to apply.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.