I am developing a Java Swing application which sends a report on a specific day and time of a week, say for example the report time is Wed 09:00:00. I am trying to calculate the time difference between current Day and time with report Time. For example:
DayTime1 = “Wed 09:00:00”
DayTime2 = “Tue 13:00:00”
How do I calculate the time difference between these two values? I tried by myself, but I couldn’t even get close to the result.
You need to create the String into Date objects and then calculate the duration between the two instances.