mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 10:34:25 +00:00
Replace java.util.Date and java.util.Calendar with java.time.* equivalents.
This commit is contained in:
@@ -8,7 +8,9 @@
|
||||
package org.dspace.embargo;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -61,9 +63,9 @@ public class DayTableEmbargoSetter extends DefaultEmbargoSetter {
|
||||
}
|
||||
String days = termProps.getProperty(terms);
|
||||
if (days != null && days.length() > 0) {
|
||||
long lift = System.currentTimeMillis() +
|
||||
long lift = Instant.now().toEpochMilli() +
|
||||
(Long.parseLong(days) * 24 * 60 * 60 * 1000);
|
||||
return new DCDate(new Date(lift));
|
||||
return new DCDate(LocalDateTime.ofEpochSecond(lift, 0, ZoneOffset.UTC));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user