com.atlassian.bitbucket.timezone.TimeZoneService |
Provides access to the time zones used in Bitbucket. There are three types of time zones:
user.timezone
. When not explicitly set the
the JVM inherits the the time zone from the launching user. This zone is used for most non-display
related tasks, such as log timestamps.
It is also the default time zone when no other can be found. See getJvmTimeZone()
.
setServerTimeZone(ZoneId)
and
getServerTimeZone()
.
Given a user the lookup for a time zone returns the first configured time zone of user, server and JVM
in that order. There will always be a JVM time zone to return if all else fails. See
getTimeZone()
and getTimeZone(ApplicationUser)
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the configured server time zone.
| |||||||||||
Return the time zone the current user has explicitly configured.
| |||||||||||
Set the server time zone.
| |||||||||||
Set the time zone of the current user.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.atlassian.bitbucket.timezone.UserTimeZoneSupplier
|
getJvmTimeZone()
if necessary.
Return the configured server time zone. empty()
will be returned if no server time zone is
configured.
Return the time zone the current user has explicitly configured. This method will return empty()
when no time zone is configured.
NOTE: Use getTimeZone()
when looking up the time zone that is applicable to the current user (e.g.
when rendering dates). The getTimeZone
method will always return a time zone by falling back to a
set of defaults.
empty()
if there is none.
Set the server time zone. null
may be passed to clear the setting.
zone | the zone of configure or null to clear the setting.
|
---|
Set the time zone of the current user. A user is always able to change its own time zone.
zone | the time zone to set for the current user. null may be passed
to indicate the user has no configured time zone. |
---|
AuthorisationException | if called anonymously |
---|---|
IllegalUserStateException | if the context user type does not support setting a time zone. |