From 5c78a8d2faa99398b2a8170fd3cf804ae0385e94 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sun, 15 Jun 2014 18:59:28 +0200 Subject: [PATCH] [MNG-5648] Regression of MNG-5176, DST in effect is ignored --- .../main/java/org/apache/maven/cli/CLIReportingUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java index cc649b514e..8d06cd6132 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.InputStream; +import java.util.Date; import java.util.Locale; import java.util.Properties; import java.util.TimeZone; @@ -153,6 +154,10 @@ public static String formatTimestamp( long timestamp ) TimeZone tz = TimeZone.getDefault(); int offset = tz.getRawOffset(); + // Raw offset ignores DST, so check if we are in DST now and add the offset + if( tz.inDaylightTime( new Date( timestamp ) ) ) + offset += tz.getDSTSavings(); + long m = Math.abs( ( offset / ONE_MINUTE ) % 60 ); long h = Math.abs( ( offset / ONE_HOUR ) % 24 );