Skip to content

Commit

Permalink
Solr Timezone Issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jmelo-lyncode authored and helix84 committed Feb 21, 2014
1 parent f8f0468 commit 7737b8b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dspace-oai/src/main/java/org/dspace/xoai/util/DateUtils.java
Expand Up @@ -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;

/**
*
Expand All @@ -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;
}

Expand Down

0 comments on commit 7737b8b

Please sign in to comment.