Get the timeZone of the connected user

Hi Guys,

How to get the timezone of the Connected User? In fact, I'm getting the value of the Date/Time CustomField related to the timeZone of the Server, what I need is the value related to the timezone of the connected user. Could you please help?

For more details, kindly, check my last comment in https://answers.atlassian.com/questions/324977/get-datetime-customfield-value?page=1#comment-325305

Thanks,

Rosy

4 answers

This widget could not be displayed.

I cannot give you absolutely correct answer, but most possible, you should get user using

https://docs.atlassian.com/jira/6.2.1/com/atlassian/jira/user/util/UserUtil.html

and then either check the user property or user preference (I have idea that it is the second)

https://docs.atlassian.com/jira/6.2.7/com/atlassian/jira/user/UserPropertyManager.html

https://docs.atlassian.com/jira/6.2.7/com/atlassian/jira/user/preferences/UserPreferencesManager.html

This widget could not be displayed.

Thanks Alexey for the tip :) !

I got it using the following code:

ExtendedPreferences extPref = userPreferencesManager.getExtendedPreferences(authenticationContext.getUser());

log.debug("timeZone: " + extPref.getString(PreferenceKeys.USER_TIMEZONE));

Many thanks,

Rosy

This widget could not be displayed.

Hi Rosy, Did you get t api to get Date/Time field value related to the timezone of the connected user. If yes, can you please share it.

This widget could not be displayed.

Hello Sreenivas P, No I didn't find it. If you check my latest comment here, you will see how I resolved it! :) Regards, Rosy

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

155 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you