Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you use the [NSDate dateWithTimeIntervalSinceNow:] method?

Tags:

objective-c

How do you use the [NSDate dateWithTimeIntervalSinceNow:] method?

I would appreciate it if someone could post some example code. (There is no example in the documentation.)

like image 354
Shakti Avatar asked Dec 08 '09 10:12

Shakti


1 Answers

NSDate * OneHourAway = [NSDate dateWithTimeIntervalSinceNow:3600]

The argument is in seconds. 3600 = 60 * 60 = 60 minutes = 1 hour

like image 164
Alex Deem Avatar answered Oct 21 '22 07:10

Alex Deem