java.time.OffsetDateTime.with(TemporalField field, long newValue) java.time.OffsetDateTime.with() 方法示例 java.time.OffsetDateTime.withDayOfMonth() 方法示例 java.time.OffsetDateTime.with(TemporalField field, long newValue) package com.codingdict; import java.time.OffsetDateTime; import java.time.temporal.ChronoField; public class OffsetDateTimeDemo { public static void main(String[] args) { OffsetDateTime date = OffsetDateTime.parse("2017-01-03T10:15:30+01:00"); OffsetDateTime result = date.with(ChronoField.DAY_OF_MONTH,13); System.out.println(result); } } java.time.OffsetDateTime.with() 方法示例 java.time.OffsetDateTime.withDayOfMonth() 方法示例