OffsetTime atDate() method in Java with examples
The atDate() method of OffsetTime class in Java combines this time with a date to create a OffsetDateTime.
public OffsetDateTime atDate(LocalDate date)
Parameter: This method accepts a single parameter date which specifies the date to combine with, not null.
Return Value: It returns the OffsetDateTime formed from this time and the specified date, not null
Below programs illustrate the atDate() method:
Program 1 :
Current date: 2018-12-31 Current date and time: 2018-12-31T11:10:10+06:03
Program 2 :
Current date: 2018-12-31 Current date and time: 2018-12-31T12:15:14+16:03
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.