Example usage for java.time Instant parse

List of usage examples for java.time Instant parse

Introduction

In this page you can find the example usage for java.time Instant parse.

Prototype

public static Instant parse(final CharSequence text) 

Source Link

Document

Obtains an instance of Instant from a text string such as 2007-12-03T10:15:30.00Z .

Usage

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant);
}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.getEpochSecond());
}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.getNano());
}

From source file:Main.java

public static void main(String[] args) {
    System.out.println(Instant.parse("2014-02-20T20:21:20.432Z"));
}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.equals(Instant.now()));

}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.isAfter(Instant.now()));

}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.toString());

}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.toEpochMilli());

}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.isBefore(Instant.now()));

}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.hashCode());
    System.out.println(instant.getEpochSecond());
}