获取12小时制/24小时制时间

  NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
            NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];//en_US_POSIX
            [formatter setLocale:locale];
            NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
            [formatter setTimeZone:timeZone];
formatter.AMSymbol = @"上午";
                formatter.PMSymbol = @"下午";
                [formatter setDateFormat:@"aaKK:mm"];

参考:http://blog.csdn.net/fly_89/article/details/17883571

你可能感兴趣的:(获取12小时制/24小时制时间)