objective-c 获取当前时间

NSDateFormatter *nsdf2=[[[NSDateFormatter alloc] init]autorelease];

 

[nsdf2 setDateStyle:NSDateFormatterShortStyle];

 

[nsdf2 setDateFormat:@"YYYYMMDDHHmmssSSSS"];

 

NSString *t2=[nsdf2 stringFromDate:[NSDate date]];

 

long curr=[t2 longLongValue];

你可能感兴趣的:(Date)