Hello,
Is there a way to get the timeZone of the server where the instance Jira is installed through the code?
Thanks,
Rosy
Pleae refer to https://docs.atlassian.com/jira/latest/com/atlassian/jira/timezone/TimeZoneService.html
Thanks Alexey.
I got it in a different method (easier one);
I transformed the date/time value of the customField into a Calendar Object and I used the method getTimeZone from that object like this:
Calendar calendarOfDateTimeCustomField = new GregorianCalendar(Integer.valueOf(year),Integer.valueOf(month)-1,Integer.valueOf(day),Integer.valueOf(hour),Integer.valueOf(minute),Integer.valueOf(second));
log.debug("currentServer TimeZone: " + calendarOfDateTimeCustomField.getTimeZone().getRawOffset());
I would not say this method is easier, but, if that works for you - it's fine) Please note that your code should be well commented to explain what are you doing if you plan to support it somehow.
Thanks Alexey for the feedback, well noted, however, I didn't comment it here because I'm just explaining the method that i used instead of getting the timezone of the server (just to inform you that I didn't have the chance to try the method in the link above and get back to you with the result).
It looks like you're new here. Sign in or register to get started.