开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜