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
- From Hours
- From Minutes
The output is shown in
ISO8601 format
.
Perform Arithmetic Operations On Duration
As of Joda-Time 2.3, The following arithmetic operations are supported:
- Addition: Adding millis to a duration
- Repeated Addition: Addition millis to a duration repeated for a certain number of times
- Subtraction: Subtracting millies from a duration
The output is shown in
ISO8601 format
.
Convert Duration To Single Fields Periods like Days, Hours, Minutes and Seconds
The output is shown in
ISO8601 format
.
To start, click on the next arrow. If you find anything missing in the tutorials then please drop in your comments.