Local datetime when using UI kit

I am trying to display a UTC datetime in local time for the user in confluence. Normally this is no problem because the browser will convert the Date() objects.

As UI kit is running on a server all datetime is UTC and needs to be converted before displayed to the user. I am looking for a way to obtain the timezone information of the current user.

For jira apps timezone is provided via https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/#api-rest-api-3-myself-get

For confluence you can obtain data about the current user via https://developer.atlassian.com/cloud/confluence/rest/api-group-users/#api-api-user-get but there is no timezone information.

Questions:

  1. How do I find the timezone of the current user when relying on data from confluence?

  2. Is there a space-specific timezone setting I should follow instead of the user?

1 Like