[Logo]
Forums Register Login
API methods for difference between two dates
Somebody please tell me why don't create the Sun create methods for calculate difference between two dates? Days between two dates for example.

Thanks,
Peter
I don't know why Sun didn't add that to the standard library. But calculating the difference between to dates is easy. You just look at the millisecond values of your two Date objects and subtract them - then you have the difference in milliseconds. It's straightforward to convert this to days (just divide by 24 * 60 * 60 * 1000, which is the number of milliseconds in one day).
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards


This thread has been viewed 770 times.

All times above are in ranch (not your local) time.
The current ranch time is
Sep 19, 2018 22:22:53.