Example usage for java.time ZonedDateTime now

List of usage examples for java.time ZonedDateTime now

Introduction

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

Prototype

public static ZonedDateTime now() 

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();
    ZonedDateTime n = dateTime.plusSeconds(1234);
    System.out.println(n);/*w  w  w.j  av a 2  s .c  o m*/
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();

    System.out.println(dateTime.getHour());
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();
    ZonedDateTime n = dateTime.withSecond(1234);
    System.out.println(n);/*from  w w  w .  jav a 2s .  c  o  m*/
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();
    ZonedDateTime l = dateTime.withLaterOffsetAtOverlap();
    System.out.println(l);// w w  w  .j a v  a 2 s  .c o  m
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();
    ZonedDateTime n = dateTime.plusMonths(12);
    System.out.println(n);/*from   w  ww. j  ava  2  s. co  m*/
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();
    ZonedDateTime n = dateTime.plusWeeks(1234);
    System.out.println(n);/* w  ww .  jav a  2  s .c  om*/
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();

    System.out.println(dateTime.getYear());
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();
    ZonedDateTime n = dateTime.withMinute(14);
    System.out.println(n);//from ww  w  . j ava 2 s .c  o m
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();

    System.out.println(dateTime.getSecond());
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();

    System.out.println(dateTime.getDayOfMonth());
}