Passing a formatted NSDate

后端 未结 3 651
后悔当初
后悔当初 2021-01-28 19:26

Formatted dates that I am passing to an instance method are not saving/printing the correct date. Can someone please help?

Calling method code snippets:

         


        
3条回答
  •  旧时难觅i
    2021-01-28 19:34

    You have to check your formatting string. It follows these official formats.

    [dateFormatter setDateFormat:@"dd-MM-yyyy"];
    

    Small m is for minute, cap M for the month.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题