Seb*_*Seb 2 objective-c nsdate nsdateformatter nstimezone ios
我想显示这样的日期:工作日7个月.我做了这个,我有正确的语法.
NSDateFormatter* df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"EEEE dd MMMM"];
[df setTimeZone:[NSTimeZone localTimeZone]];
Run Code Online (Sandbox Code Playgroud)
记录的结果是:3月16日星期六.我只想要法国约会,而不是英国约会.我尝试设置本地时区但它什么都没改变.你知道怎么做吗?
使用标识符初始化语言环境.您可以从中获取所有可用的标识符
[NSLocale availableLocaleIdentifiers];
Run Code Online (Sandbox Code Playgroud)
我相信@"fr_BI"是法语标识符之一
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"fr_BI"];
[dateFormatter setLocale:locale];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2308 次 |
| 最近记录: |