Allen Rohner <aroh...@gmail.com> writes:

> 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.

Interesting.

> 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.

What this means to me is that the earlier, later, and time-between
functions will need to behave differently if the units used are
variable-length (days and up) vs invariable (seconds, minutes, hours).

> 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 don't think it would be too hard to remove naive conversions between
days/weeks etc and seconds from Chrono. But I do agree that it shouldn't
be adopted for any use until this is done. And it may be harder than I
suspect. We'll see.

>> 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.

Yes, but any library that requires third-party jars can't be used out of
the box in contrib, and I think a language that doesn't support
date-processing out of the box is at a severe disadvantage.

-Phil

--~--~---------~--~----~------------~-------~--~----~
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