java.time.LocalDateTime.ofInstant() 方法示例


java.time.LocalDateTime.ofInstant() 方法示例

package com.codingdict;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;

public class LocalDateTimeDemo {
   public static void main(String[] args) {

      LocalDateTime date = LocalDateTime.ofInstant(Instant.now(), ZoneId.systemDefault());
      System.out.println(date);  
   }
}