How to display picker view in MM-dd-yy format in iOS 5.1?

后端 未结 5 1261
挽巷
挽巷 2020-12-06 10:51

In my application i am using pickerview

My problem is that when in iOS 4.3 Picker view comes MM-dd-yy format,

5条回答
  •  遥遥无期
    2020-12-06 11:39

    For this you can make your custom picker.

    Or you want to format the date then use this code..

    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setDateFormat:@"MM-dd-yy"];
    NSString *date = [dateFormat stringFromDate:datePicker.date];    
    NSLog(@"date is >>> , %@",date);
    

提交回复
热议问题