OffsetTime atDate(LocalDate date) example

Description

OffsetTime atDate(LocalDate date) combines this time with a date to create an OffsetDateTime.

Syntax

atDate has the following syntax.


public OffsetDateTime atDate(LocalDate date)

Example

The following example shows how to use atDate.


import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.OffsetTime;
/*from   www  .  j  a v  a 2s. c om*/
public class Main {
  public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetDateTime n = m.atDate(LocalDate.now());
    System.out.println(n);

  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset