Overview This article covers miscellaneous How-Tos for Joda-Time. Convert 2 Digit Year To 4 Digit Year Using Pivot Year Get List Of Default Time Zones Verify Whether A Partial DateTime Is Contiguous Convert 2 Digit Year To 4 Digit Year Using Pivot Year In Joda-Time, it is possible to convert 2 digit year to 4 … Read more
Overview By default DateTime class in Joda-Time API is immutable. However Joda-Time gives an option to create Mutable version of DateTime called MutableDateTime . This article describes the usage of MutableDateTime . Modify Fields Add Fields To MutableDateTime Perform Rounding Operations Modify Fields Use setter methods to modify fields in MutableDateTime Add Fields To MutableDateTime … Read more
Overview This article describes how to modify the values in an Interval using MutableInterval Modify Interval Modify Interval Start and end instants of a MutableInterval can be modified by using Duration Millis Period To start, click on the next arrow. If you find anything missing in the tutorials then please drop in your comments.
Joda-Time: Using MutablePeriod Overview This article describes the ways to modify fields in MutablePeriod . Modify Period Modify Period MutablePeriod can be modified in two ways: Using Setter method Adding values to fields To start, click on the next arrow. If you find anything missing in the tutorials then please drop in your comments.
Overview Single Field Period is defined as Period using a single date or time field like , etc. In some use cases, date and time related manipulations need to be performed on a single field. Joda-Time provides the following convenience classes to directly represent the single field periods: Years Months Days Weeks Hours Minutes Seconds … Read more
Overview This article describes the usage of DateTimeZone Constructing DateTimeZone Get DateTimeZone Fields Constructing DateTimeZone DateTimeZone can be constructed using the following ways: Default Using TimeZone Id Using Offset Hours from UTC Using Offset Hours and Minutes from UTC Using Offset Millis from UTC Using JDK TimeZone Get DateTimeZone Fields Fields in DateTimeZone fields like … Read more
Overview Duration specifies a length of time in milliseconds. Refer to Duration on Joda-Time site for further details. Create Duration Perform Arithmetic Operations On Duration Convert Duration To Single Fields Periods like Days, Hours, Minutes and Seconds Create Duration Duration can be created using the following ways: Using two DateTime instances Using Millis From Days … Read more
Overview An Instant represents a point in time independent of Chronology or TimeZone. Creating Instant Comparing Two Instants Get Sub-Fields of Instant Perform Arithmentic Operations On Instant like Addition, Subtraction and Repeated Addition Convert Instant To Other Representations Like DateTime, MutableDateTime,JDK Date and String Creating Instant Instant can be created in the following ways: Using … Read more
Overview An Interval represents the period of time between two Instant s. Refer to Interval on Joda-Time site for further details. Construct An Interval Find Relationship Between Two Intervals (Gap, Adjoining, Overlap) Modify Interval Using Millis, Duration and Instant Construct An Interval Interval can be constructed in the following six ways: Using start and end … Read more
Overview This article describes the various ways to compare two DateTime instances. Compare DateTime Compare Two DateTime instances considering only Date fields and ignoring TIme fields Compare Two DateTime instances considering only Time fields and ignoring Date fields Using Upper and Lower Limits for DateTime comparison Compare DateTime Use DateTimeComparator.getInstance() to get a comparator for … Read more