Example usage for java.time Duration getSeconds

List of usage examples for java.time Duration getSeconds

Introduction

In this page you can find the example usage for java.time Duration getSeconds.

Prototype

public long getSeconds() 

Source Link

Document

Gets the number of seconds in this duration.

Usage

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    System.out.println(duration.toString());
}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    System.out.println(duration.hashCode());
}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());

    System.out.println(Duration.ofSeconds(2340).equals(duration));
}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());

    System.out.println(Duration.ofSeconds(2340).compareTo(duration));
}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    duration = duration.minus(duration);
    System.out.println(duration.getSeconds());

}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    duration = duration.plus(duration);/*from ww  w.j av a 2s .co m*/
    System.out.println(duration.getSeconds());

}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    duration = duration.minusDays(3);/* w ww  . j  ava  2s  . co  m*/
    System.out.println(duration.getSeconds());

}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    duration = duration.plusSeconds(4000);
    System.out.println(duration.getSeconds());

}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    duration = duration.plusHours(4);//from  ww w  .  j a  v a  2 s  .  co  m
    System.out.println(duration.getSeconds());

}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    duration = duration.plusDays(4);/*from w w w  .  j a v  a 2s  .c  o m*/
    System.out.println(duration.getSeconds());

}