2011-11-16 98 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

与此我们可以得到该格式的字符串或日期,但我想应用12小时日期格式日期选择器控制器。 – RJ168

相关问题