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


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

package com.codingdict;

import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneId;

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

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