Start with the official website to download the JSR 310 reference implementation: jsr-310-ri-0.6.3.jar, jsr-310-TZDB-all-0.6.3.jar
Then use Groovy to demo what
D:\downloads>set JAVA_OPTS=-Xbootclasspath/p:jsr-310-ri-0.6.3.jar;jsr-310-TZDB-all-0.6.3.jar D:\downloads>\sdk\groovy-1.7.2\bin\groovysh Groovy Shell (1.7.2, JVM: 1.6.0_23) Type 'help' or '\h' for help. ----------------------------------------------------------------------- groovy:000> import javax.time.* ===> [import javax.time.*] groovy:000> import javax.time.calendar.* ===> [import javax.time.*, import javax.time.calendar.*] groovy:000> london = TimeZone.of("Europe/London") ===> Europe/London groovy:000> date1 = ZonedDateTime.of(1752, 9, 2, 0, 0, 0, 0, london) ===> 1752-09-02T00:00-00:01:15[Europe/London] groovy:000> date2 = date1.plus(Period.ofDays(1).withHours(8)) ===> 1752-09-03T08:00-00:01:15[Europe/London] groovy:000> date2.toLocalDate() ===> 1752-09-03 groovy:000> eastern = TimeZone.of("US/Eastern") ===> US/Eastern groovy:000> date3 = ZonedDateTime.of(1752, 9, 2, 0, 0, 0, 0, eastern) ===> 1752-09-02T00:00-04:56:02[US/Eastern] groovy:000> date4 = date3.plus(Period.ofDays(1).withHours(4), ZoneResolvers.retainOffset()) ===> 1752-09-03T04:00-04:56:02[US/Eastern] groovy:000> quit
Before some of the dialogue:
klauszou I really came to talk about which languages have not seen a real full sound to write the date of the Gregorian calendar class so Every time I see a spade comes loaded to force in the class also wrote you with people who feel to laugh
klauszou m $ to say on this point is very interesting to know to write well, so simply put problems of the time period may have ruled out the www
rednaxelafx @ klauszou Java's new Date Time API (JSR 310) and perhaps the line? Seeking evaluation
klauszou not used, is not clear how specific, but you can be very simple to verify, first of all it has no location parameter, would certainly not perfect toka RT: @ rednaxelafx: @ klauszou Java's new Date Time API (JSR 310 ) may also work? Seeking evaluation
klauszou give a simple example, not all countries have also started using the Gregorian calendar, and historically, including the UK, countries like the United States until the 18th century began, and therefore the calculation of the Julian Gerry makeup set in 1752, and Calculation of the traditional European countries making it up in 1582. Assumed to be related to the time zone is more complex
rednaxelafx @ klauszou Well, that example I do not know how to verify the good. See that there are such API, seemingly advanced than the simple offset some http://is.gd/jiN76
klauszou. @ rednaxelafx authentication method is simple, the European makeup is October 4, 1582 began to make up for 10 days, the next day for the new calendar on October 15. United States or Britain, then from September 2, 1752 began to make up for 11 days, that the next day is a new calendar on September 14. Looked rough, this more than most are tricky, but should not be perfect.
klauszou. @ rednaxelafx'd calculated the relative time zone well, and several special circumstances are taken into account, but in relation to the issue of location should still have problems
So it seems the reference implementation of JSR 310 is considered comprehensive enough?
JSR 310 API to use up the whole feel is very smooth, two sets of time than the existing API JDK better Unfortunately, Oracle does not know when it will go into JDK. JDK7 mostly hopeless, JDK8 I am afraid ...