📜  添加月份到日期 swift 代码示例

📅  最后修改于: 2022-03-11 15:00:59.479000             🧑  作者: Mango

代码示例1
Swift 5:

let months: Int = 3
let date: Date = Date()
let calendar: Calendar = Calendar.current
let nextDate: Date? = calendar.date( byAdding: Calendar.Component.month, value: months, to: date )