Example usage for java.time OffsetTime now

List of usage examples for java.time OffsetTime now

Introduction

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

Prototype

public static OffsetTime now() 

Source Link

Document

Obtains the current time from the system clock in the default time-zone.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    boolean z = m.isSupported(ChronoUnit.HOURS);
    System.out.println(z);/*from w w  w . ja v  a2s. co  m*/

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    long n = m.until(OffsetTime.now(), ChronoUnit.MINUTES);
    System.out.println(n);/*from  ww w  .  j  a va2 s.c  om*/

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.plus(34, ChronoUnit.DAYS);
    System.out.println(n);//from  w w w  .  j ava  2  s.co  m

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.truncatedTo(ChronoUnit.DAYS);
    System.out.println(n);//  w w  w .  j  a v  a2s. c om

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.minus(14, ChronoUnit.DAYS);
    System.out.println(n);//from   ww w  .  j a  va  2s  . c  o  m

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    long z = m.getLong(ChronoField.HOUR_OF_DAY);
    System.out.println(z);/* www.  j a  v  a2 s  .co  m*/

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.with(ChronoField.HOUR_OF_DAY, 4);
    System.out.println(n);// w  w w . ja  v a  2s  . co  m

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    boolean z = m.isSupported(ChronoField.HOUR_OF_DAY);
    System.out.println(z);//  w w  w. j  a  v  a2s  .c  om

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    int z = m.get(ChronoField.HOUR_OF_DAY);
    System.out.println(z);//from  ww  w  .jav a2s. c  o 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  .ja v a 2s  .  co m*/

}