LocalDate atStartOfDay(ZoneId zone) example

Description

LocalDate atStartOfDay(ZoneId zone) returns a zoned date-time from this date at the earliest valid time according to the rules in the time-zone.

Syntax

atStartOfDay has the following syntax.


public ZonedDateTime atStartOfDay(ZoneId zone)

Example

The following example shows how to use atStartOfDay.


import java.time.LocalDate;
import java.time.ZoneId;
//from  ww w .  jav a 2 s . c  o  m
public class Main {
  public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);

    System.out.println(a.atStartOfDay(ZoneId.systemDefault())); 
  }
}

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