Subtract minutes from NSDate

Ishu picture Ishu · Feb 14, 2011 · Viewed 20.5k times · Source

I want to subtract some minutes 15 min 10 min etc., And i am having date object with time now i want to subtract minutes.

Answer

jamihash picture jamihash · Feb 14, 2011

Use following:

// gives new date object with time 15 minutes earlier
NSDate *newDate = [oldDate dateByAddingTimeInterval:-60*15];