Add 1 Day to a Date in iOS (iPhone)



A Date value encapsulates a single point in time, independent of any particular calendrical system or time zone. Date values represent a time interval relative to an absolute reference date.

Here we will be seeing how to add 1 day to date,

For this, we will be using Playground, Copy the below code in Playground,

let date = Date()
let addedDate = Calendar.current.date(byAdding: .day, value: 1, to: date)
print(addedDate ?? "")
Updated on: 2019-08-30T11:40:21+05:30

147 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements