如何在iOS中将NSDate转移到偏移时间格式?

时间:2015-11-11 14:45:29

标签: ios objective-c time nsdate

如何使用目标C在iOS中传输NSDate到偏移时间格式(2015-08-05 16:33:29 +02:00)?

1 个答案:

答案 0 :(得分:0)

尝试:

    NSDate *date = [NSDate date];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
    [dateFormatter setDateFormat:@"yyyy'-'MM'-'dd HH':'mm':'ss ZZZ"];
    NSLog(@"%@",[dateFormatter stringFromDate:date ]);