The problem is the ambiguous representation of the date. The only accurate
representation is the internal millisecond value. If I say the date day 11
of month 10 of 1492, you cannot reliably determine what it really is. I have
not told you the calendar system being used -- perhaps it is hebrew. If a
time is also specified, then I need to explain what time zone rules are in
place.
When Joda-Time says 1492-10-11T00:00:00.000-07:52:58, it has given you an
ambiguous representation. The complete representation might be
"1492-10-11T00:00:00.000-07:52:58, using the proleptic gregorian calendar,
with TZ database version 2008i". The complete representation for Date might
be "Mon Oct 01 23:52:58 PST 1492, using a gregorian/julian calendar with a
julian cutover date of 1582-10-15, with the timezone rules of Sun JDK
1.6.0_07."
Although you perceive the dates as being "defacto" different, they are in
fact the same date. Welcome to the wonderful world of ambiguous date
representations. The ISO 8601 standard attempts to solve this, but Java's
Date is not ISO 8601 compliant. Joda-Time is.
On Tue, Nov 11, 2008 at 10:46 AM, Andreas Guther <
[EMAIL PROTECTED]> wrote:
> I am not sure if I can follow your argumentation. Yes, the internal milli
> seconds of the returned Date is the same as the milli seconds contained in
> the returning DateTime object. But this does not change the fact, that the
> returned Date object is defacto a different date than what the DateTime
> object represents. And correct me if I am wrong, all boils down to the
> usage of millisecond, doesn't it?
>
> If I construct the Date object using Calendar and setting each field
> explicitly as done below, then I get the correct Date object and the
> milliseconds are quite different.
>
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest