美文网首页
把毫秒转换成日期

把毫秒转换成日期

作者: UILabelkell | 来源:发表于2016-01-01 23:08 被阅读61次

<pre>
double time = [_model.timeNumber doubleValue];
NSDate *date = [[NSDate alloc]initWithTimeIntervalSince1970:time/1000.0];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setLocale:[[NSLocale alloc]initWithLocaleIdentifier:@"en_US"]];
[dateFormatter setDateFormat: @"yyyy-MM-dd HH:mm:ss"];
NSString *sgtr = [dateFormatter stringFromDate:date];
</pre>

未完成待续。。。。。。。。。

相关文章

网友评论

      本文标题:把毫秒转换成日期

      本文链接:https://www.haomeiwen.com/subject/tkdwhttx.html