码迷,mamicode.com
首页 > 移动开发 > 详细

PHP 时间戳 转时间 for ios 8*3600

时间:2017-04-25 16:54:40      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:.text   formatter   ext   mda   from   log   nsstring   ndt   时间戳   

// 时间戳 转时间

        

      

        int intTimeString = [_model.date intValue];

        NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:intTimeString];

        NSLog(@"confromTimesp %@", confromTimesp);

 

        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];

        NSTimeZone * timeZone = [NSTimeZone timeZoneForSecondsFromGMT:8*3600];

        [formatter setTimeZone:timeZone];

        [formatter setDateStyle:NSDateFormatterMediumStyle];

        [formatter setTimeStyle:NSDateFormatterShortStyle];

        [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];

        NSString  * formatedTime = [formatter stringFromDate:confromTimesp];

        NSLog(@"formatedTime is %@",formatedTime);

        _SendTimeLabel.text = formatedTime;

        

PHP 时间戳 转时间 for ios 8*3600

标签:.text   formatter   ext   mda   from   log   nsstring   ndt   时间戳   

原文地址:http://www.cnblogs.com/tangyuanby2/p/6762231.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!