关于IOS时间日历的一些注意事项 NSDateFormatter

1.时间或者日期格式化的格式化,在真机上运行的是hi,必须指定是在哪个区域的,不然在真机无法显示

 

    // 1.日期格式化

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

    fmt.dateFormat = @"EEE MMM dd HH:mm:ss Z yyy";

    fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; // 根据返回的数据是美国区域的格式,所以这里得指定一个美国那边的格式才可以.

    NSDate *creatDate = [fmt dateFromString:_created_at];

posted @ 2015-09-04 16:43  第三维  阅读(183)  评论(0编辑  收藏  举报