So I am trying to subtract 2 dates I have come up with this code :
java.text.DateFormat df = new java.text.SimpleDateFormat("hh:mm:ss_yyyy.MM.dd");
java.util.Date date1 = new java.util.Date();
java.util.Date date2 = df.parse("00:00:00_2013.01.01");
long diff = date2.getTime() - date1.getTime();
But the problem is the diff isn’t correct.
Can anybody tell me what I am doing wrong ?
Your diff sample in the comment is wrong. I tried your code and got this result:
And roughly checked 70 days until new year sounds solid.