iPhone - how to get user's date format

2019-05-21 10:20发布

How can I know what date format user prefers? Is there a way to read it from phone's local settings? Does the user prefer to read date in format "dd/mm/yyyy" or "mm/dd/yyyy"?

Thank you in advance.

7条回答
可以哭但决不认输i
2楼-- · 2019-05-21 11:17

Do you really want to know the exact format, or just convert between NSDate and NSString objects according to it? If the latter, then NSDateFormatter is your man, automatically producing the right format for the user's preferences.

查看更多
登录 后发表回答