lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gsing...@apache.org
Subject svn commit: r579765 - /lucene/java/trunk/contrib/gdata-server/src/core/src/java/org/apache/lucene/gdata/utils/DateFormater.java
Date Wed, 26 Sep 2007 19:13:00 GMT
Author: gsingers
Date: Wed Sep 26 12:12:59 2007
New Revision: 579765

URL: http://svn.apache.org/viewvc?rev=579765&view=rev
Log:
LUCENE-1005, apply GMT timeZone to the data formatter so it outputs properly formatted dates

Modified:
    lucene/java/trunk/contrib/gdata-server/src/core/src/java/org/apache/lucene/gdata/utils/DateFormater.java

Modified: lucene/java/trunk/contrib/gdata-server/src/core/src/java/org/apache/lucene/gdata/utils/DateFormater.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/core/src/java/org/apache/lucene/gdata/utils/DateFormater.java?rev=579765&r1=579764&r2=579765&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/core/src/java/org/apache/lucene/gdata/utils/DateFormater.java
(original)
+++ lucene/java/trunk/contrib/gdata-server/src/core/src/java/org/apache/lucene/gdata/utils/DateFormater.java
Wed Sep 26 12:12:59 2007
@@ -22,6 +22,7 @@
 import java.util.Date;
 import java.util.Locale;
 import java.util.Stack;
+import java.util.TimeZone;
 
 /**
  * This class uses the {@link java.text.SimpleDateFormat} class to format dates
@@ -123,9 +124,12 @@
     }
 
     protected SimpleDateFormat getFormater() {
-        if (this.objectStack.empty())
-            return new SimpleDateFormat(DateFormater.HTTP_HEADER_DATE_FORMAT,Locale.ENGLISH);
-        return this.objectStack.pop();
+        if (this.objectStack.empty()) {
+          SimpleDateFormat dateFormat = new SimpleDateFormat(DateFormater.HTTP_HEADER_DATE_FORMAT,
Locale.ENGLISH);
+          dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+          return dateFormat;
+        }
+      return this.objectStack.pop();
     
     }
 



Mime
View raw message