How to add 1 day to a Date in iOS/iPhone?

iOSApps/ApplicationsMobile Development

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 ?? "")
raja
Published on 30-Aug-2019 15:10:21
Advertisements