Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create timestamp of now as NSNumber in objective-c

How can I get timestamp as NSNumber? I only need something like this: 1232885280

like image 883
Burjua Avatar asked Aug 10 '10 12:08

Burjua


1 Answers

NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970];
// NSTimeInterval is defined as double
NSNumber *timeStampObj = [NSNumber numberWithDouble: timeStamp];
like image 168
Vladimir Avatar answered Oct 22 '22 17:10

Vladimir