📜  java 即时到 localdatetime - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:42.710000             🧑  作者: Mango

代码示例2
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);