The FileUtils uses LocalTime.now() in isFileNewer/Older, for example:

    public static boolean isFileNewer(final File file, final ChronoLocalDate 
chronoLocalDate) {
        return isFileNewer(file, chronoLocalDate, LocalTime.now());
    }

Thus if I create a file yesterday at 10am and I test the file using:

ChronoLocalDate chronoLocalDate = LocalDate.now().minus(1, ChronoUnit.DAYS);

This will pass at 9am but fail at 11 am:

FileUtils.isFileNewer(file, chronoLocalDate);

I do not think this is desired behaviour. I have added notes to the javadoc to 
state that the time is assumed to be now.

However I think it may be better to use LocalTime.MIDNIGHT for consistency. 
Thus if you input only a date the time is assumed to be zero.

Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to