Example usage for java.time OffsetTime withOffsetSameInstant

List of usage examples for java.time OffsetTime withOffsetSameInstant

Introduction

In this page you can find the example usage for java.time OffsetTime withOffsetSameInstant.

Prototype

public OffsetTime withOffsetSameInstant(ZoneOffset offset) 

Source Link

Document

Returns a copy of this OffsetTime with the specified offset ensuring that the result is at the same instant on an implied day.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime l = m.withOffsetSameInstant(ZoneOffset.UTC);
    System.out.println(l);//  www  .  j av  a  2  s .  c o  m

}