java.time.ZonedDateTime.ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) java.time.ZonedDateTime.ofInstant() 方法示例 java.time.ZonedDateTime.ofLocal() 方法示例 java.time.ZonedDateTime.ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) package com.codingdict; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.ZoneId; public class ZonedDateTimeDemo { public static void main(String[] args) { ZonedDateTime date = ZonedDateTime.ofInstant(LocalDateTime.now(),ZoneOffset.UTC, ZoneId.systemDefault() ); System.out.println(date); } } java.time.ZonedDateTime.ofInstant() 方法示例 java.time.ZonedDateTime.ofLocal() 方法示例