arangodb/java-velocypack

DateUtil does incorrect conversion of UTC time

christian-lechner opened this issue · 2 comments

Hi,

the com.arangodb.velocypack.internal.util.DateUtil does incorrect conversion of java.util.Date objects. The error is that the format is set to ISO 8601 in UTC but the time zone is not taken into account.
A date, e.g. Mon Apr 16 17:17:21 CEST 2018 would be converted to 2018-04-16T17:17:21Z, but correct would be 2018-04-16T15:17:21Z.

Fix:

SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); 
formatter.setTimeZone(TimeZone.getTimeZone("UTC"));

Best regards

Thanks for reporting

Fixed with version 1.0.15