How to 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: 30-Aug-2019

112 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements