Consider a code:
TemporalAccessor date = DateTimeFormatter.ofPattern(\"yyyy-MM-dd\").parse(\"9999-12-31\");
Instant.from(date);
The last line t
public static void main(String[] args) throws ParseException {
System.out.println(new SimpleDateFormat("yyyy-MM-dd").parse("2016-12-31").toInstant());
}
the above code gives the following output:
2016-12-31T00:00:00Z
i have answered this question using features('toInstant' method) of java 8. hope this answers your question...