Permalink
Browse files

Solr Timezone Issue fixed

  • Loading branch information...
1 parent f8f0468 commit 7737b8b7dbfd00bf2b88530f2c62f6041238df24 @lyncodev lyncodev committed with helix84 Nov 27, 2013
Showing with 5 additions and 4 deletions.
  1. +5 −4 dspace-oai/src/main/java/org/dspace/xoai/util/DateUtils.java
@@ -7,13 +7,14 @@
*/
package org.dspace.xoai.util;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
-
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Logger;
+import java.util.TimeZone;
/**
*
@@ -33,8 +34,8 @@ public static String formatToSolr(Date date, boolean init)
// 2008-01-01T00:00:00Z
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.'000Z'");
if (!init) sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.'999Z'");
+ sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
String ret = sdf.format(date);
- System.out.println(ret);
return ret;
}

0 comments on commit 7737b8b

Please sign in to comment.