Joda Equivalent of Date data structure
The Date data structure from java.util is almost being depreciated. Hence, we use to have our very own data structure to represent Date (With year, month and date only. N开发者_如何学Co time information)
SimpleDate
I was wondering is there any equivalent data structure in Joda library?
If my project would like to convert to use Joda, there are some extra work. Because previously my project is using convention in Java Calendar, by having January as 0. In Joda, the January is 1
Joda uses LocalDate to represent a date without time or timezone information.
Use DateTime#toLocalDate()
to obtain the local date part.
LocalDate localDate = dateTime.toLocalDate();
Note that months are nowhere in JodaTime 0-based.
精彩评论