java - How to convert a LocalDate to an Instant? -


I work with Java 8's new datetime API.

An instant on a local date? Me

  local date date = local date (2012, 2, 2) with an exception; Instant instant = instant. (Date);   

And I do not understand why.

In order for you to immediately convert it, you should have a local datetime example, for example: < / P>

  LocalDate.now (). AtStartOfDay () ToInstant (ZoneOffset.UTC)    

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c++ - Redefined variable in the other module -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -