Skip to content
Snippets Groups Projects
Commit 6e96f8e7 authored by Stefan E. Funk's avatar Stefan E. Funk
Browse files

fix: implement comments from mr

parent 8fa4d57a
No related branches found
No related tags found
No related merge requests found
Pipeline #349589 passed
......@@ -155,18 +155,22 @@ public class OaipmhUtilities {
log.fine("original DateTimeString: " + originalDateTimeString);
Instant instant;
try {
OffsetDateTime odt = OffsetDateTime.parse(originalDateTimeString);
result = UTC_FORMATTER.format(Instant.from(odt));
instant = Instant.from(odt);
}
// TODO We are missing to set time zones on dcterms date fields!! Workaround for all DARIAH-DE
// Repository dates so far is using LocalDateTime here!
// NOTE We are missing to set time zones on dcterms date fields in administrative metadata!
// Workaround for all DARIAH-DE Repository dates so far (until fix) is using LocalDateTime here
// with ZoneId CET, what has been local time zone until now!
catch (DateTimeParseException e) {
LocalDateTime ldt = LocalDateTime.parse(originalDateTimeString);
result = UTC_FORMATTER.format(ldt.atZone(ZoneId.systemDefault()).toInstant());
instant = ldt.atZone(ZoneId.of("CET")).toInstant();
}
result = UTC_FORMATTER.format(instant);
log.fine("parsed to UTC: " + result);
return result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment