commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r165669 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/DateUtil.java
Date Mon, 02 May 2005 19:50:16 GMT
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


Mime
View raw message