I work with the new DateTime API of Java 8.
How to convert a LocalDate to an Instant? I get an exception with
LocalDate date = LocalDate.of(2012, 2, 2);
Instant instant = Instant.from(date);
and I don't understand why.
In order to convert it to an instant you need to have a LocalDateTime instance, e.g.:
LocalDate.now().atStartOfDay().toInstant(ZoneOffset.UTC)