Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a scenario, in which I should be calculating the difference between two dates (date format MM-dd-yyyy).
I tried doing this using TalendDate.diffDate(Date1 ,Date2), but I am getting different results for different dates.
For Example: TalendDate.diffDate("12-31-2015 ,"12-01-2015") the result is 30(correct), but for TalendDate.diffDate("03-31-2015 ,"03-01-2015") the result is 29 (wrong), similarly for some other dates. The results should be long or integer.
In the job I designed, the start and end dates are calculated in the job itself based on other dates in some cases and in some cases, we extract dates from database. Both the cases the issue is same.
I tried few other solutions which were provided in the forum, but it didn't help me.
Please help me out.
Thanks,
Bharath
public static long diffDate(Date date1, Date date2, String dateType, boolean ignoreDST)