首页 > 代码库 > PHP 时间戳 转时间 for ios 8*3600

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

// 时间戳 转时间

        

      

        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