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]];

posted @ 2013-05-16 15:06  cqclassic  阅读(486)  评论(0编辑  收藏  举报