2011-11-16 2 views

답변

0

이 시도 :

NSDateFormatter *detailsTimeFormatter = [[NSDateFormatter alloc] init]; 
    [detailsTimeFormatter setTimeStyle:NSDateFormatterShortStyle]; 
    NSLog(@"%@",[[detailsTimeFormatter stringFromDate:[NSDate date]] lowercaseString]); // this will return you the time with am/pm 
+0

내가 날짜 선택 컨트롤러에 12 시간의 시간대를 설정합니다. 그러니까 그 재산을 알면. 고맙습니다. – RJ168

+0

NSDateFormatter를 사용해야합니다 :'[datePickerFormat setDateFormat : @ "HH : mm"];' http://stackoverflow.com/questions/4360402/uidatepicker-return-value-in-24-hour-format 가이드 : http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns – relower

+0

이 형식으로 문자열이나 날짜를 가져올 수 있지만 날짜 선택기 컨트롤러에 12hr 날짜 형식을 적용하고 싶습니다. – RJ168