Skip to content

Commit bae1692

Browse files
committed
A quick one line fix the timezone bug in validateInternalTimestampIsNotOutdated(). #12354
1 parent 823c754 commit bae1692

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/edu/harvard/iq/dataverse/api/AbstractApiBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ public Command<DatasetVersion> handleLatestPublished() {
488488
}
489489

490490
protected void validateInternalTimestampIsNotOutdated(DvObject dvObject, String sourceLastUpdateTime) throws WrappedResponse {
491-
Date date = sourceLastUpdateTime != null ? DateUtil.parseDate(sourceLastUpdateTime, "yyyy-MM-dd'T'HH:mm:ss'Z'") : null;
491+
Date date = sourceLastUpdateTime != null ? DateUtil.parseDate(sourceLastUpdateTime.replaceFirst("Z$", "+0000"), "yyyy-MM-dd'T'HH:mm:ssZ") : null;
492492
if (date == null) {
493493
throw new WrappedResponse(
494494
badRequest(BundleUtil.getStringFromBundle("jsonparser.error.parsing.date", Collections.singletonList(sourceLastUpdateTime)))

0 commit comments

Comments
 (0)