Class TimeHelper
java.lang.Object
org.hibernate.search.util.common.impl.TimeHelper
Helpers for classes in java.time.*
-
Method Summary
Modifier and TypeMethodDescriptionstatic ZonedDateTimeparseZoneDateTime(String value, DateTimeFormatter formatter) Workaround for https://bugs.openjdk.java.net/browse/JDK-8066982, which at the moment has only been solved for JDK9.static LongtoMillisecondsRoundedUp(Long time, TimeUnit timeUnit) Converts in milliseconds a time duration expressed withtimeandtimeUnit.
-
Method Details
-
parseZoneDateTime
Workaround for https://bugs.openjdk.java.net/browse/JDK-8066982, which at the moment has only been solved for JDK9.Tested against TCKDTFParsedInstant in http://hg.openjdk.java.net/jdk9/dev/jdk/rev/f371bdfb7875 with both JDK8b101 and JDK9 (early access - build 137).
- Parameters:
value- The value to be parsedformatter- The formatter to use when parsing- Returns:
- The parsed
ZonedDateTime
-
toMillisecondsRoundedUp
Converts in milliseconds a time duration expressed withtimeandtimeUnit. The result value is rounded up. If either of the parameters is null, it will return null.- Parameters:
time- a time durationtimeUnit- the time unit used to express the duration- Returns:
- rounded up duration in milliseconds
-