mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-28 03:55:20 +00:00
[JENKINS-71965] fix timezone in build history (#8800)
* [JENKINS-71965] fix timezone in build history the timezone shown was always the daylight saving time when the users selected timezone has daylight saving. The change will now consider the actual timestamp of the build to determine if it was in daylight saving time to properly calculate the timezone to show. * make locale aware
This commit is contained in:
1 parent
df03159afe
commit
48da635be2
2 files changed
+3
-3
No files matched your search
@@ -692,13 +692,13 @@ public class Functions {
|
||||
}
|
||||
|
||||
@Restricted(NoExternalUse.class)
|
||||
public static String getUserTimeZonePostfix() {
|
||||
public static String getUserTimeZonePostfix(Date date) {
|
||||
if (!isUserTimeZoneOverride()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
TimeZone tz = TimeZone.getTimeZone(getUserTimeZone());
|
||||
return tz.getDisplayName(tz.observesDaylightTime(), TimeZone.SHORT);
|
||||
return tz.getDisplayName(tz.inDaylightTime(date), TimeZone.SHORT, getCurrentLocale());
|
||||
}
|
||||
|
||||
@Restricted(NoExternalUse.class)
|
||||
|
||||
Reference in new issue
Block a user