Java ZonedDateTime Create zonedDateTime(String date, ZoneId zoneId)

Here you can find the source of zonedDateTime(String date, ZoneId zoneId)

Description

zoned Date Time

License

Open Source License

Declaration

public static ZonedDateTime zonedDateTime(String date, ZoneId zoneId) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class Main {
    private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");

    public static ZonedDateTime zonedDateTime(String date, ZoneId zoneId) {
        return ZonedDateTime.of(LocalDateTime.parse(date, formatter), zoneId);
    }//  w w w. j a va 2 s.c  o m
}

Related

  1. toZonedDateTime(@Nullable Date date, @Nullable TimeZone zone)
  2. toZonedDateTime(Date utilDate)
  3. toZonedDateTime(long epochSeconds)
  4. toZonedDateTime(long systemMillis)
  5. toZonedDateTime(Object cell)
  6. zonedDateTimeOf(final ZonedDateTime time)
  7. zonedDateTimeToYyyyMMdd(LocalDate localDate)