Link to home
Start Free TrialLog in
Avatar of jrmc_97
jrmc_97

asked on

Difference between 2 dates

I have seen most of the solutions found here.  But I am having trouble with the calulation of the number of days when using 04/01/2004 to 04/30/2004 is calculating 29 days instead of 30.  But when I use something like 04/01/2004 - 04/03/2004 it is calcualting 3 days which is correct.  Also it is correct when I use 4/5/2004 - 04/30/2004.  it appears to only give an incorrect number when I use a start date from standard time and a end date from daylight savings time.

Anyone else experience this?

I am using the difference in milliseconds, diffMilli/(24*60*60*1000).

thanks,

Jim
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Depends what your definition of the number of days between two dates is.
>> I am using the difference in milliseconds, diffMilli/(24*60*60*1000).

Shouldn't do that. Java has all the API you need for dates.