List of usage examples for java.time ZonedDateTime getZone
@Override
public ZoneId getZone()
From source file:sorcer.file.ScratchDirManager.java
private boolean isCutoffTime(Path path, long cutOffTime) throws IOException { ZonedDateTime now = ZonedDateTime.now(); BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class); ZonedDateTime created = ZonedDateTime.ofInstant(attrs.creationTime().toInstant(), now.getZone()); created = created.withYear(now.getYear()).withMonth(now.getMonthValue()); ZonedDateTime cutoff = created.plus(cutOffTime, MILLIS); log.info("Created {}", created); log.info("now {}", now); log.info("cutoff {}", cutoff); return now.isAfter(cutoff); }