我想用标签(不是日历)显示今天的日期(希伯来日期)。
我怎么做NSDate
?
谢谢!
使用它来格式化日期:
NSLocale *hebrew = [[NSLocale alloc] initWithLocaleIdentifier:@"he_IL"];
NSDateFormatter *format = [[NSDateFormatter alloc] init];
format.locale = hebrew;
[format setDateFormat:@"MMM dd, yyyy HH:mm"];
NSDate *now = [NSDate date];
NSString *today = [format stringFromDate:now];
UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(30, 40, 240, 30)];
lbl.text = today;
NSLog(@"today: %@", today);