ios 时间戳转换成时间
2015-09-01 13:33
417 查看
时间戳转换成时间
NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; formatter.timeZone = [NSTimeZone timeZoneWithName:@"shanghai"]; [formatter setDateStyle:NSDateFormatterMediumStyle]; [formatter setTimeStyle:NSDateFormatterShortStyle]; [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; NSDate* date = [NSDate dateWithTimeIntervalSince1970: [[self.dataDict objectForKey:@"create_time"] integerValue]]; NSString* dateString = [formatter stringFromDate:date]; cell.timeLabel.text = dateString;
相关文章推荐
- 个人对runtime的理解
- iOS 简单理解协议代理的执行原理
- IOS8下的数据搜索
- 71.iOS 错误堆栈查找崩溃原因的方法---根据崩溃信息,找到对应的崩溃代码
- tableView中需要点击一次才能跳转的问题
- iOS使用AVCaptureSession自定义相机
- iOS8新特性
- iOS设计模式——Category
- iOS中的沙盒机制
- IOS--文件管理NSFileManager
- ios中关于delegate(委托)的使用心得
- OC内存管理
- iOS 视频拍摄与压缩
- autorelease探究
- 深入浅出iOS事件机制
- iOS 的一种设计模式 类别 catagory
- iOS 初级数据持久化
- iOS中assign,copy,retain之间的区别以及weak和strong的区别
- iOS5 ARC学习笔记:strong、weak等详解
- iOS断言 NSAssert的使用