DatePicker时间显示不正确问题处理代码

指定下格式就成了。。

NSDate *selected=[datePicker date];

    NSDateFormatter *dateFormat = [[NSDateFormatteralloc] init];

    [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm"];

    NSString *message=[[NSString alloc] initWithFormat:@"The date and time you slected is:%@",[dateFormat stringFromDate:selected]];

转载于:https://www.cnblogs.com/cqclassic/archive/2013/05/16/3081871.html

你可能感兴趣的:(DatePicker时间显示不正确问题处理代码)