From the line I am taking the date in the format:
"yyyy-MM-dd'T'HH:mm:ss" When I try to compare this date with LocalDateTime.now() I always get the current date after the date from the line. Plus the date from the line gives 0 when .getNano()
Example:
DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss") String dateStr = "2012-01-20T02:15:12"; LocalDateTime date = LocalDateTime.parse(dateStr, DATE_FORMAT); What am I doing wrong?
LocalDateTime.now().withNano(0)- Alexandr