There are 2 data as below. I will subtract these data from each other and check if there is a 10-minute difference between them. How can I do this in java?
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
String db_share_time="2022-05-12 12:15:39";
System.out.println(dtf.format(dtf.parse(db_share_time)));
System.out.println(dtf.format(now));
Output:
2022-05-12 12:15:39
2022-11-03 14:42:28