gpt4 book ai didi

ios - 如何转换 NSDate 中的命令以显示希伯来日历日期?

转载 作者:行者123 更新时间:2023-11-28 22:46:45 24 4
gpt4 key购买 nike

这是我的代码:

NSDate *today = [NSDate date];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateStyle:NSDateFormatterShortStyle];
NSString *dateString = [dateFormat stringFromDate:today];
[_label setText:dateString];

我需要做什么?

最佳答案

据我所知,您需要设置日期格式化程序的日历(可能还有语言环境)。

设置日历:

[dateFormat setCalendar:[[[NSCalendar alloc] initWithCalendarIdentifier:kCFHebrewCalendar] autorelease]];

设置语言环境:

[dateFormat setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:kCFHebrewCalendar] autorelease]];

关于ios - 如何转换 NSDate 中的命令以显示希伯来日历日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13027801/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com