Cedric Georges wrote:But NetBeans gives me the following result:
NetBeans?
You should use your favourite text editor and javac/java
Cedric Georges wrote:On http://docs.oracle.com/javase/8/docs/api/, I don't find anything about toEpochTime. But there is a toEpochSecond function.
Can you help me please?
Probably nothing more but a (minor) typo in the study guide. The
Java API of LocalDateTime clearly mentions
the toEpochSecond method (and just like the Java compiler, the Java API is always correct

). But in order to invoke this method, you'll need a zone offset as well (and
null is not allowed). And for completeness: there's a
LocalDateTime.ofEpochSecond(long epochSecond, int nanoOfSecond, ZoneOffset offset) as well. So it definitely is
xxEpochSecond (and not
xxEpochTime).
(PS. I notified the authors of this errata item)