NSDateFormatter Locale

前端 未结 4 1854
Happy的楠姐
Happy的楠姐 2021-01-05 15:19

How to set Locale for NSDateFormatter? I\'ve tried the below code and its not working.

- (NSString *)localizedStringWithFormat:(NSString *)format {

    NSDa         


        
4条回答
  •  别那么骄傲
    2021-01-05 15:27

    in case someone will look for Swift 3 solution:

    let dateFormatter = DateFormatter()
    let frLocale = Locale(identifier: "fr")
    dateFormatter.locale = frLocale
    

提交回复
热议问题