i want to calculate days between date field fetched from access database and current date .can any body tell me how to do it
posted 10 years ago
Something like this maybe:
The getTime returns milliseconds. So you calculate the difference in millis. Then we divide it by 1000 (second) * 60 (minutes) * 60 (hours) * 24 (days).
You have to take care of rounding yourself of course. In the example the result will get Floored (everything behind the comma will get ignored). You must use Math.round (and proper casting) if you want to round it.