3 ms·
The java.time.* are the new classes (IIRC, based on joda-time), but there are also the old time libraries in java.util.* and java.text.*. I don't know which one
by cesarb 6y ago
The java.time.* are the new classes (IIRC, based on joda-time), but there are also the old time libraries in java.util.* and java.text.*. I don't know which ones the parent poster was talking about, but it might be the old ones.
- vips7L 6y agoYes I know they're "new", but the Java time API was released 7 years ago with JDK 8. I don't think its fair to be critical of something that was fixed almost a decade ago.
- charrondev 6y agoUnfortunately a lot of people don’t have access to Java 8 on the largest customer facing Java platform (android). The java.time libraries are available on android starting API level 26 https://developer.android.com/reference/java/time/package-summary https://developer.android.com/reference/java/time/package-su... That is android 11, released in September of 2020 which is not widely distributed. Does anyone know why the delay? It looks like Java 8 language features finally became compatible through some compatibility layer in Gradle 4. Was it because of the lawsuits?
- vips7L 6y agoPersonally, I don't consider Android to be Java and I am quite happy that Google is pushing Kotlin now instead.
- ohgodplsno 6y agoBasically, yes. Google has been awfully slow at implementing some Java 8+ features. Their current solution is D8 desugaring, which basically rewites all the APIs into JDK8 compatible code.
- EddieRingle 6y agoThis is incorrect. You can use APIs like java.time on any version by using desugaring: https://developer.android.com/studio/write/java8-support#library-desugaring https://developer.android.com/studio/write/java8-support#lib...
- szatkus 6y agoThe problem is that many Java projects in the wild are... well, old. Some of them haven't migrated to Java 8 yet and even then you can stuck with a lot of code using the old API.
- jeltz 6y agoThere is sadly still new code written which uses the old API. I just inherited code from 2019 which uses the old text me API.