//获取当前时间 NSDateFormatter *nsdf2=[[[NSDateFormatter alloc] init]autorelease]; [nsdf2 setDateStyle:NSDateFormatterShortStyle]; [nsdf2 setDateFormat:@"YYYYMMDDHHmmssSSSS"]; NSString *t2=[nsdf2 stringFromDate:[NSDate date]];
//获取系统当前的时间戳 NSDate* dat = [NSDate dateWithTimeIntervalSinceNow:0]; NSTimeInterval a=[dat timeIntervalSince1970]*1000; NSString *timeString = [NSString stringWithFormat:@"%f", a];//转为字符型