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();
    OffsetTime n = m.withSecond(34);
    System.out.println(n);

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    int n = m.getHour();
    System.out.println(n);

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();

    System.out.println(m.isAfter(OffsetTime.now()));

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.plusHours(34);
    System.out.println(n);

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.minus(Period.ofDays(12));
    System.out.println(n);/*from  w  w w  . j a  v a 2s  .  co m*/

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.plus(Period.ofDays(12));
    System.out.println(n);//  www  .  j  a  v a 2 s .  c om

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    LocalTime l = m.toLocalTime();
    System.out.println(l);

}

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);/*w  w  w.ja  v  a 2s .  c  o  m*/

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime l = m.withOffsetSameLocal(ZoneOffset.UTC);
    System.out.println(l);//from ww  w.  j a  v  a  2  s  . c om

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    ZoneOffset z = m.getOffset();
    System.out.println(z);

}