We have launched a free Basic Kubernetes Course. Click here to enrol now! Kubernetes is a container orchestration platform used by enterprises worldwide and Kubernetes developers are in high demand!
class in Joda-Time API is immutable. However Joda-Time gives an option to create Mutable version of
This article describes the usage of
Use setter methods to modify fields in
Add Fields To MutableDateTime
Fields can be added to
using the following ways:
- Using add..() methods to directly add the value of field
- Adding Duration: Using the following 3 ways:
- Using DurationFieldType
- Directly adding Duration
- Adding Duration in Millis
- Adding Period
Perform Rounding Operations
Joda-Time API provides supports for rounding off
to the nearest field.
In particular, the following types of rounding are supported:
- Floor: Round to the nearest floor
- Ceiling; Round to the nearest ceiling
- Half Floor: Round to the floor if the value of the field is closer to floor or exactly halfway. Else round to ceiling
- Half Ceiling: Round to the floor if the value of the field is closer to floor or exactly halfway. Else round to ceiling
- No Rounding
To start, click on the next arrow. If you find anything missing in the tutorials then please drop in your comments.