Example usage for java.time OffsetDateTime atZoneSimilarLocal

List of usage examples for java.time OffsetDateTime atZoneSimilarLocal

Introduction

In this page you can find the example usage for java.time OffsetDateTime atZoneSimilarLocal.

Prototype

public ZonedDateTime atZoneSimilarLocal(ZoneId zone) 

Source Link

Document

Combines this date-time with a time-zone to create a ZonedDateTime trying to keep the same local date and time.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    ZonedDateTime d = o.atZoneSimilarLocal(ZoneId.systemDefault());
    System.out.println(d);/*from   www . j a  v  a2 s . com*/
}