akosma / SwiftMoment

A time and calendar manipulation library for iOS 9+, macOS 10.11+, tvOS 9+, watchOS 2+ written in Swift 4.
http://akosma.github.io/SwiftMoment
BSD 2-Clause "Simplified" License
1.61k stars 147 forks source link

Get Tomorrow's date #102

Open keithmichelson opened 6 years ago

keithmichelson commented 6 years ago

I'm trying to get tomorrow's date like this, but it just returns today's.

moment().add(1, "days").format("MMMM do")

This works fine in Javascript moment().add(1, "days").format("MMMM Do")

Your Environment

Swift 4.0 Xcode Version 9.2 (9C40b)

charu3308 commented 5 years ago

let currentDateMoment = moment(currentDate) let numberOfDateMoment = currentDateMoment.add(numberOfDays, TimeUnit.Days) return numberOfDateMoment.date let current date is your from date how manys to added to number of days