>
> What's the status of this JSR? Is it possible the JDK 7 will include
> more palatable date processing capabilities? I think it would be a shame
> if external libraries were required to get sane date processing in
> Clojure, but if the JDK 7 has potential to fix it, that's encouraging.
>

As far as I can tell, the JSR was approved to go into Java 7, but
there is some risk of them not being done by the deadline. JSR-310 is
a complete re-write, I assume for licensing reasons.

> Most of the problems mentioned seem to be related to timezones. It seems
> the worst case scenario is simply to have Chrono support no
> timezone-aware operations out of the box on JDKs 5 and 6, but be able to
> offer greater capabilities if either the JDK 7 or Joda time is
> installed. I agree that having a more limited library is better than
> having one that claims to have greater capabilities, but has bugs.
>

Yes, most problems I've encountered and read about are timezone
problems. I'll keep going back to the "number of days between Jan 1
and June 1" problem, because it's easy and instructive. You cannot
answer that correctly without specifying a timezone. And if you "don't
support timezones", the only timezone where your library can be used
correctly is UTC.

One of the large advantages of Joda is that the API is constructed in
such a way that it is obvious what will happen. For example, there are
two ways to specify a duration, an Instant and a Partial. An Instant
is used to say "now + 86400 seconds". A partial is used to say "now +
1 week". Those are two different operations because they can have two
different results depending on the current year and timezone.

This is actually a very convenient time to write this note, because it
makes my examples easy. :-) Where I live, Daylight Savings Time
happens this Sunday, and my timezone will change from Central Standard
Time to Central Daylight Time. It is currently Friday Mar 6 10:40 am
CST. If I ask for "now + 7 days", the correct answer is "Friday Mar
13, 10:40 am CDT". But if I ask for "now + 86400 seconds", the correct
answer is "Friday Mar 13, 11:40 am CDT". Naively converting from
seconds to days/weeks/months/years is not a well defined operation in
most timezones.

> I'm not convinced the problems can't be worked around once we are made aware 
> of them, but it definitely merits further investigation.

I'm sure the problems can be worked around once you're aware of them,
but a correct solution will end up with a lot of the same concepts as
Joda, and definitely won't have the same API as you do now. If you
base Chrono on Joda you can avoid all of that pain now.

Allen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to