相关疑难解决方法(0)

根据currentLocale的NSDateformatter setDateFormat

我很生气,可能是一个愚蠢的问题.

我有3个字符串:年,月和日.我需要有一个基于currentLocale的正确格式的日期,所以如果currentLocale localeIdentifier是en_US我的dateFormat应该是:MMM/dd/yyyy

如果它是fr_FR,则dateFormat应为dd/MMM/yyyy

我不认为这样做的唯一方法是获取currentLocale localeIdentifier并从一堆if开始.

提前致谢.

马克斯

cocoa-touch nsdateformatter ios nslocale

10
推荐指数
2
解决办法
1万
查看次数

标签 统计

cocoa-touch ×1

ios ×1

nsdateformatter ×1

nslocale ×1