Example usage for java.time ZonedDateTime ofInstant

List of usage examples for java.time ZonedDateTime ofInstant

Introduction

In this page you can find the example usage for java.time ZonedDateTime ofInstant.

Prototype

public static ZonedDateTime ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) 

Source Link

Document

Obtains an instance of ZonedDateTime from the instant formed by combining the local date-time and offset.

Usage

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime z = ZonedDateTime.ofInstant(LocalDateTime.now(), ZoneOffset.UTC, ZoneId.systemDefault());

    System.out.println(z);//from   w ww.java2  s . c  o m

}