private final static String[] DATE_FORMATS = new String[]{
DEFAULT_DATEFORMAT,
"yyyy-MM-dd'T'HH:mm:ss.SS'Z'",
+ "yyyy-MM-dd"
};
//Had to add this and TIME_ZONE_PAT to handle tz with colons.
if (date == null) {
return "";
}
-
+
SimpleDateFormat df = new SimpleDateFormat(DEFAULT_DATEFORMAT, Locale.ROOT);
df.setTimeZone(LocaleUtil.TIMEZONE_UTC);
return df.format(date);
props.setCreatedProperty("2007-05-12T06:00:00-0200");
assertEquals(dateToInsert, props.getCreatedProperty().getValue());
+ props.setCreatedProperty("2015-07-27");
+ assertEquals(msdf.parse("2015-07-27T00:00:00.000Z"), props.getCreatedProperty().getValue());
+
props.setCreatedProperty("2007-05-12T10:00:00.123+0200");
assertEquals(msdf.parse("2007-05-12T08:00:00.123Z"), props.getCreatedProperty().getValue());