Java ZonedDateTime Create toZonedDateTime(Date utilDate)

Here you can find the source of toZonedDateTime(Date utilDate)

Description

to Zoned Date Time

License

Apache License

Declaration

public static ZonedDateTime toZonedDateTime(Date utilDate) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;

public class Main {
    public static ZonedDateTime toZonedDateTime(Date utilDate) {
        if (utilDate == null) {
            return null;
        }//from w  w w  .j  a  v  a2 s  . c  om
        final ZoneId systemDefault = ZoneId.systemDefault();
        return ZonedDateTime.ofInstant(utilDate.toInstant(), systemDefault);
    }
}

Related

  1. toZonedDateTime(@Nullable Date date, @Nullable TimeZone zone)
  2. toZonedDateTime(long epochSeconds)
  3. toZonedDateTime(long systemMillis)
  4. toZonedDateTime(Object cell)
  5. zonedDateTime(String date, ZoneId zoneId)