You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ol...@apache.org on 2005/05/02 21:50:16 UTC

svn commit: r165669 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/DateUtil.java

Author: olegk
Date: Mon May  2 12:50:15 2005
New Revision: 165669

URL: http://svn.apache.org/viewcvs?rev=165669&view=rev
Log:
PR #34583 (DateUtil.formatDate() uses default timezone instead of GMT)

Contributed by Fred Bierhaus <fred.bierhaus at vodafone.com>
Reviewed by Michael Becke, Ortwin Glück & Oleg Kalnichevski

Modified:
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/DateUtil.java

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/DateUtil.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/DateUtil.java?rev=165669&r1=165668&r2=165669&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/DateUtil.java (original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/DateUtil.java Mon May  2 12:50:15 2005
@@ -82,6 +82,8 @@
         DEFAULT_TWO_DIGIT_YEAR_START = calendar.getTime(); 
     }
     
+    private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
+    
     /**
      * Parses a date value.  The formats used for parsing the date value are retrieved from
      * the default http params.
@@ -203,6 +205,7 @@
         if (pattern == null) throw new IllegalArgumentException("pattern is null");
         
         SimpleDateFormat formatter = new SimpleDateFormat(pattern);
+        formatter.setTimeZone(GMT);
         return formatter.format(date);
     }
     



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org