Example usage for java.time.format DateTimeFormatter ISO_OFFSET_TIME

List of usage examples for java.time.format DateTimeFormatter ISO_OFFSET_TIME

Introduction

In this page you can find the example usage for java.time.format DateTimeFormatter ISO_OFFSET_TIME.

Prototype

DateTimeFormatter ISO_OFFSET_TIME

To view the source code for java.time.format DateTimeFormatter ISO_OFFSET_TIME.

Click Source Link

Document

The ISO time formatter that formats or parses a time with an offset, such as '10:15+01:00' or '10:15:30+01:00'.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.parse("18:26:06.325-07:00", DateTimeFormatter.ISO_OFFSET_TIME);

    System.out.println(m);/*w w  w.ja  v a2 s .co  m*/

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    String s = m.format(DateTimeFormatter.ISO_OFFSET_TIME);
    System.out.println(s);//ww w.j  ava  2  s .  c  om

}