Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 7 Date/Time API [closed]

I notice that a snapshot of the Java 7 API has been up on java.sun.com for some time, but I only just had a look through it just now, looking specifically for the promised JodaTime-inspired Date/Time API. Alas, I can find no mention of it in the published docs.

Is this because it simply hasn't been done yet, and this published API is an early, incomplete snapshot, or because the idea has been quietly dropped?

like image 359
skaffman Avatar asked Aug 17 '09 10:08

skaffman


People also ask

Why time API is introduced in Java 8 as we already have date related API?

New date-time API is introduced in Java 8 to overcome the following drawbacks of old date-time API : Not thread safe : Unlike old java. util. Date which is not thread safe the new date-time API is immutable and doesn't have setter methods.

Which of the Java API is contain both date and time?

time. LocalDateTime: It handles both date and time, without a time zone. It is a combination of LocalDate with LocalTime.

What does getTime () do in Java?

getTime. Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.


2 Answers

Alex Miller is running a very informative website about jdk7 features.

JSR 310 is still not confirmed according to this page.

like image 95
dfa Avatar answered Oct 06 '22 21:10

dfa


Last I heard, JSR 310 was running behind and might not get into Java 7. And yes, that's a huge shame - although at least we've got Joda Time as a stopgap until then.

like image 45
Jon Skeet Avatar answered Oct 06 '22 21:10

Jon Skeet