NSDateFormatter *nsdf2=[[[NSDateFormatter alloc] init]autorelease];
[nsdf2 setDateStyle:NSDateFormatterShortStyle];
[nsdf2 setDateFormat:@"YYYYMMDDHHmmssSSSS"];
NSString *t2=[nsdf2 stringFromDate:[NSDate date]];
long curr=[t2 longLongValue];
本文介绍了一个NSDateFormatter的具体应用案例,展示了如何设置日期样式并转换日期为特定格式的字符串。通过这个例子,读者可以了解到NSDateFormatter的基本用法及其在实际开发中的应用场景。
NSDateFormatter *nsdf2=[[[NSDateFormatter alloc] init]autorelease];
[nsdf2 setDateStyle:NSDateFormatterShortStyle];
[nsdf2 setDateFormat:@"YYYYMMDDHHmmssSSSS"];
NSString *t2=[nsdf2 stringFromDate:[NSDate date]];
long curr=[t2 longLongValue];
1290

被折叠的 条评论
为什么被折叠?
