ZoneOffsetTransition of() method in Java with Example
The of() method of java.time.zone.ZoneOffsetTransition class is used to create the object of zone offset transition with the help of local date time, offset before and offset after.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
public static ZoneOffsetTransition of(LocalDateTime transition, ZoneOffset offsetBefore, ZoneOffset offsetAfter)
Parameter: This method takes the following argument as a parameter.
- transition: object of local date time for which transition have to be created.
- offsetBefore: object of zone offset for initial transition.
- offsetAfter: object of zone offset for final transition.
Return Value: This method returns the object of zone offset transition with the help of local date time, offset before and offset after.
Below are the examples to illustrate the of() method:
zone offset transition : Transition[Overlap at 1999-04-25T03:24:45+00:00:12 to +00:00:08]
zone offset transition : Transition[Overlap at 2018-04-25T03:24:45+00:00:12 to +00:00:08]