IOS- 1970ms时间计算
2015-11-27 12:49
501 查看
//创建时间
NSInteger numTime = [dict[@"createTime"][@"time"] longLongValue]/1000;
NSDate *nowTime = [NSDate dateWithTimeIntervalSince1970:numTime];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSString *dateString = [dateFormat stringFromDate:nowTime];
cd.createTime = dateString;
NSInteger numTime = [dict[@"createTime"][@"time"] longLongValue]/1000;
NSDate *nowTime = [NSDate dateWithTimeIntervalSince1970:numTime];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSString *dateString = [dateFormat stringFromDate:nowTime];
cd.createTime = dateString;
相关文章推荐
- iOS 警告收录及科学快速的消除方法
- iOS本地通知详解
- NSDictionary、NSArray、NSString、NSData互转
- iOS开发缺少framework对应错误提示
- IOS技术调研
- iOS企业开发者账号申请流程(未完待续)
- iOS 判断邮箱 手机号 是否正确
- 如何处理iOS中照片的方向
- 如何设计一个 iOS 控件?(iOS 控件完全解析)
- iOS 单元测试之XCTest详解(一),iosxctest
- IOS静态库制作
- iOS6、7各自的导航栏、状态栏
- 关于iOS的autolayout中导航栏的疑问
- 行为驱动开发iOS
- iOS开发日记49-详解定位CLLocation
- Nagios 安装
- ios开发之 icon规范+启动图规范+启动页规范
- iOS9适配之应用跳转(URLSchemes)
- iOS开发中导航控制器的基本使用教程
- iOS---设置btn边框