java.time.OffsetDateTime.of(LocalDate date, LocalTime time, ZoneOffset offset) java.time.OffsetDateTime.of(LocalDate date, LocalTime time, ZoneOffset offset) java.time.OffsetDateTime.ofInstant() 方法示例 java.time.OffsetDateTime.of(LocalDate date, LocalTime time, ZoneOffset offset) package com.codingdict; import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.ZoneOffset; public class OffsetDateTimeDemo { public static void main(String[] args) { LocalDateTime localDateTime = LocalDateTime.parse("2017-02-03T12:20:30"); OffsetDateTime date = OffsetDateTime.of(localDateTime,ZoneOffset.UTC); System.out.println(date); } } java.time.OffsetDateTime.of(LocalDate date, LocalTime time, ZoneOffset offset) java.time.OffsetDateTime.ofInstant() 方法示例