用到的是NSDate的
- (NSTimeInterval)timeIntervalSince1970
NSString * timestamp = [NSString stringWithFormat:@"%f",[[NSDate date] timeIntervalSince1970] * 1000];
(times 1000 for milliseconds, otherwise, take that out)
用到的是NSDate的
- (NSTimeInterval)timeIntervalSince1970
NSString * timestamp = [NSString stringWithFormat:@"%f",[[NSDate date] timeIntervalSince1970] * 1000];
(times 1000 for milliseconds, otherwise, take that out)
本文标题:Unix Timestamp 时间戳转换
本文链接:https://www.haomeiwen.com/subject/umskhttx.html
网友评论