Anyway to figure out the timezone of the jira cloud instance.
tried using serverinfo, but it return something like -0800, but i would like something that would indicate if a location would have day light saving.
thanks
Anyway to figure out the timezone of the jira cloud instance.
tried using serverinfo, but it return something like -0800, but i would like something that would indicate if a location would have day light saving.
thanks
The time offset is the effective current offset. That is, if it says -0800 then it is 8 hours behind GMT right now.
It doesn’t describe the timezone though, so it’s not possible to know “If I checked back in a month’s time, would the offset to GMT have changed?”
Hi,
We use AC Spring Boot and believe we found a way to achieve this but are not sure if it is a reliable one.
In order to get the timezone of a Jira instance, we send a request to /rest/api/3/myself using authenticatedAsAddon. Thus, we can get the timezone of the addon’s user, and it seems that the addon’s timezone always equals Jira’s timezone.
@bkelley Can we count on the addon’s Jira user for timezone?
Hi. If you want to know the instance’s timezone, serverinfo is more reliable:
Like rickhe298, we also need the location, but serverInfo does not contain this information.
In our application, users can create calendars with timezone selection, and then we make some calculations using these saved calendars. While installing the application, we want to automatically create a default calendar for the client and set its timezone as the timezone of the client’s Jira instance. Since this is a one-time operation, we must set the timezone based on the location. Otherwise, we cannot handle time differences due to daylight saving policies of different countries.
That’s actually a tricky problem. In some sense there is no “location” for the server.
I wonder if this is helpful: You use the timezone as a view on the times for events in the calendar. The event starts at a particular instance in time, but what the user calls that instant in time depends on the user’s timezone.
Thus checking what the timezone was for the instance when you installed your app is not enough. It’s probably better to use the current user’s timezone when displaying times. That is, if this event starts in 1 hour from now, it starts 1 hour from now regardless of your timezone. The way I describe the time it starts to the current user depends on their timezone.
Keep in mind that a person’s timezone and locale are considered personal data.
Thank you for the answer.
In our app, timezone settings configured by users can be used by any user in Jira, so timezones need to be global and we want to set the default timezone as Jira’s timezone. Users are responsible for updating the application’s timezone settings if calculations are needed for different timezones. As a result, setting the timezone on install once is not an issue for us at the moment.
Putting everything aside, can we say that when we send a request to /rest/api/3/myself with the privileges of the app (authenticatedAsAddon), the timezone on Jira’s System → General configuration page will always return?
I think it is risky to assume that the “myself” endpoint will return the system timezone. Currently if a user does not have a timezone configured, this is the behaviour, but I think if you really want to know the system timezone it is risky to rely on this. Especially when the serverinfo call explicitly tells you the timezone.
@bkelley the problem is that the serverinfo call (GET /rest/api/3/serverInfo) does not return the exact timezone. It only returns offset in “serverTime” property which is not enough to designate the exact timezone that has information about the summer time and DST.
I think the real question here is: how to get via api the value of ‘Default user time zone’ configured in Jira > System > General configuration ?
Currently serverinfo call includes the value of ‘Default language’ in defaultLocale.locale property. Can we have in response defaultTimeZone too?