Forums Register Login

date manipulation

+Pie Number of slices to send: Send
i want to calculate days between date field fetched from access database and current date .can any body tell me how to do it
+Pie Number of slices to send: Send
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.
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 722 times.
Similar Threads
How to get the Dates in-between two Dates
Writing a query that uses the current date
comparison of dates
how to covert string to date object?.
compare months between date field and system date
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:02:38.