org.joda.time Code Samples
- How do I get number of months between two dates in Joda?
- How do I get number of days between two dates in Joda?
- How do I get date / time fields of date in Joda?
- How do I get the last day of a month in Joda?
- How do I do a date calculations?
- How do I use Joda-Time's DateMidnight class?
- How do I convert DateTime into Calendar or Date object?
- How do I get the first day of the next month in Joda?
- How do I use the Interval class of Joda Time?
- How do I create DateTime object in Joda Time?
- How do I format date information in Joda?
- How do I format date in Joda using ISODateTimeFormat class?
- How do I use Joda Time Instant Class?
Page 1 of 1 |
Prev
|
Next
How do I get date / time fields of date in Joda?
In Joda the date and time information are divided into fields. The following example show you some fields that can be obtained from the DateTime object. For example to get the day of the year we use the getDayOfYear() method and to get the day of week we can use the getDayOfWeek() method.
The output of our program are:
dateTime = 2012-02-03T23:06:35.481+08:00 DOY = 34 DOM = 3 DOW = 5 WOW = 5 HOD = 23 MOH = 6 SOM = 35 MOD = 1386 SOD = 83195