friends im new using date and time in java. I stored date and time in String which is the current time similarly I have one more string variable which has the post time now I want to calculate the ago time even in seconds on any the string has date and time in this format yyyy/MM/dd HH:mm:ss can some one help me Thank you here is the code
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime currentTime = LocalDateTime.parse(d_tt, formatter);
LocalDateTime postTime = LocalDateTime.parse(post_time, formatter);
long seconds = ChronoUnit.SECONDS.between(postTime, currentTime);//(error here)
error "ChronoUnit cannot be resolved"