mirror of https://github.com/apache/maven.git
[MNG-5648] Regression of MNG-5176, DST in effect is ignored
This commit is contained in:
parent
bd2b01d4ea
commit
5c78a8d2fa
|
@ -21,6 +21,7 @@ package org.apache.maven.cli;
|
|||
|
||||
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 final class CLIReportingUtils
|
|||
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 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue