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