Answers for "difference in days between two dates java"

3

find difference in days between two dates java

String dateStart = "01/14/2015 08:29:58";
String dateStop = "01/15/2015 11:31:48";

//HH converts hour in 24 hours format (0-23), day calculation
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

Date d1 = null;
Date d2 = null;

d1 = format.parse(dateStart);
d2 = format.parse(dateStop);

//in m
Posted by: Guest on February-05-2021

Code answers related to "difference in days between two dates java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language