Jon Paris skrev den 27-01-2008 19:44:
On 27-Jan-08, at 1:00 PM, java400-l-request@xxxxxxxxxxxx wrote:

You can load it into a java.util.Date, extract the corresponding number
of milliseconds since 1970.01.01, and you can then take the difference
and round down to number of days.

This is part of the current problem - the date related classes seem to be trying to deal with Daylight Savings Time or something and when your dates cross the changeover point the results are inaccurate.

Besides - doesn't it strike you as thoroughly silly that one should even have to contemplate "playing" with milliseconds to get a count of a number of days! It is insane that such steps should be required in a so-called "modern" language.

Every language has its warts. Hence the recommendation of a third party package.

The nastiness of the Date + Calendar routines - been there, ground my teeth - is well summarized in http://www.jroller.com/cpurdy/entry/the_seven_habits_of_highly. If it helps, Calendar was written by IBM folks :)



Buying a package to solve a basic language deficiency just sticks in my craw I'm afraid.
If I had suggested you should _buy_ anything, I'd mentioned the price. This particular package is open source and free: "Joda is licenced under an Apache style licence", which should be ok regardless where you want to use it.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.