Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46982
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 8 Apr 2009 10:17:59 +0000 (10:17 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 8 Apr 2009 10:17:59 +0000 (10:17 +0000)
Use DST offset not current offset (which will be 0 when DST is not being used)

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@763166 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/valves/AccessLogValve.java

index 0b7a2fc..ebdef23 100644 (file)
@@ -27,7 +27,6 @@ import java.io.PrintWriter;
 import java.net.InetAddress;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.TimeZone;
@@ -857,8 +856,7 @@ public class AccessLogValve
         // Initialize the timeZone, Date formatters, and currentDate
         timezone = TimeZone.getDefault();
         timeZoneNoDST = calculateTimeZoneOffset(timezone.getRawOffset());
-        Calendar calendar = Calendar.getInstance(timezone);
-        int offset = calendar.get(Calendar.DST_OFFSET);
+        int offset = timezone.getDSTSavings();
         timeZoneDST = calculateTimeZoneOffset(timezone.getRawOffset() + offset);
 
         if (fileDateFormat == null || fileDateFormat.length() == 0)