C
CheGueVerra
Hi All trying to figure out how to calculate the difference in days between
two dates
TIA
CheGueVerra
two dates
TIA
CheGueVerra
CheGueVerra said:Hi All trying to figure out how to calculate the difference in days between
two dates
TIA
CheGueVerra
CheGueVerra said:Hi All trying to figure out how to calculate the difference in days between
two dates
Alan said:Each Date tracks time in milliseconds since an epoch date. Take the
difference between these two values and convert from milliseconds to days.
It depends on what he means by "difference in days."
For example, should the span from 31-Dec-2004 23:59:59
and 01-Jan-2005 00:00:01 be "an insignificant fraction
of a day, rounded down to zero" or "one day?"
CheGueVerra said:Hi All trying to figure out how to calculate the difference in days between
two dates
int daysBetween = day1.daysBetween (day2);
Tilman said:The fact remains that the problem as originally stated is under-
determined. Which implies that I think the Javadoc of Paul Hill's Day
class (specifically, of daysBetween()) is incomplete as it doesn't state
its definition of `days between', either.
[...]The Day class is different in that there is no time component,
time zone, daylight saving time or leap seconds. It is class
for modelling the running entries of a desktop calendar.
The difference between two days becomes well defined;
The Day class was written to overcome the problems
of java.util.Date and java.util.Calendar which mix
dates and times in a confusing manner:
http://geosoft.no/software/day/Day.java.html
Day day1 = new Day (year1, month1, day1);
Day day2 = new Day (year2, month2, day2);
int daysBetween = day1.daysBetween (day2);
ends. The answer to your question requires many more things to be
stipulated.
Years ago I did several searches on google to try to solve a very similar
problem. I basically got dizzy from the implications of the things I
didn't specify in my problem.
CheGueVerra said:PS, I couldn't find Day object.. so I guess it's not from sun ??? where can
I get docs on this , yup I'm nuub
Thanks for the link to your work, was very nice of you...
CheGueVerra
mine-field for almost anyone.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.