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


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

package com.codingdict;

import java.time.Instant;
import java.time.ZonedDateTime;
import java.time.ZoneId;

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

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