glowla.blogg.se

Android studio java date class
Android studio java date class








android studio java date class

This library is a backport for Android of ThreeTenBP, which in turn is a backport for Java 6 of the latest Java 8's Date Time API (same creator). I would recommend looking at the ThreeTenABP library as a better alternative (as that's what I've migrated a similar application to use). Hope this is helpful to anyone else with the same conundrum!Įdit #2: After further look into the link provided by Nguyễn Hoài Nam, I've went with the ThreeTenABP library, as it's a wrapper for the new Time class featured in Java 8, and will prove to be more fluent in use than a Calendar approach. This would make it more flexible over its implementation of the GregorianCalendar (or other specific implementations) in terms of places you can roll it out to. This is due to the Calendar interface automatically using the best implementation of it based on the locale and time zone of the user's device. However, I read on a post that due to the size of the Joda Time library, it wasn't recommended for apps.Įdit: Upon a comment from 404notfound, I decided to go with the Calendar interface. I've seen the GregorianCalendar class, and the Joda Time library. I know that the standard Date class in the Java API is horrible, so I'm just wondering which classes are recommended? What I need to do with the dates that I'm working with is things such as comparing the dates, getting the difference between them, and date calculations (such as adding/subtracting a small period of time such as two weeks or a month to any given date). I'm currently making an app for android, but I'm unsure which class is actually best to use.










Android studio java date class