Answers for "localdatetime to instant"

1

convert local datetime to instant java

covert localdatetime to Instant object 
LocalDateTime().now().toInstant(ZoneOffset.UTC)
Posted by: Guest on June-26-2021
0

java instant to localdatetime

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

// ...

//Convert instant to LocalDateTime, no timezone, add a zero offset / UTC+0
LocalDateTime ldt = LocalDateTime.ofInstant(instant, ZoneOffset.UTC);
Posted by: Guest on January-15-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language