mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 00:38:52 -05:00
avoid time zone issues by interpreting all dates and times as UTC
This commit is contained in:
parent
07ea116518
commit
dd3a87e985
@ -22,6 +22,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneOffset;
|
import java.time.ZoneOffset;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
@ -219,7 +220,7 @@ public class MediaBindingBean {
|
|||||||
|
|
||||||
if (releaseDate != null) {
|
if (releaseDate != null) {
|
||||||
// avoid time zone issues by interpreting all dates and times as UTC
|
// avoid time zone issues by interpreting all dates and times as UTC
|
||||||
long days = ChronoUnit.DAYS.between(releaseDate.toLocalDate().atStartOfDay(ZoneOffset.UTC), ZonedDateTime.now(ZoneOffset.UTC));
|
long days = ChronoUnit.DAYS.between(releaseDate.toLocalDate().atStartOfDay(ZoneOffset.UTC).toInstant(), Instant.now());
|
||||||
|
|
||||||
if (days >= 0) {
|
if (days >= 0) {
|
||||||
return days;
|
return days;
|
||||||
|
Loading…
Reference in New Issue
Block a user