NSDateFormatter “Month” in 3 letters instead of full word

后端 未结 7 1352
一生所求
一生所求 2021-02-01 03:00
    NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@\"dd-MM-YYYY HH:mm\"];        
    [formatter setTimeZone:[NSTimeZone syst         


        
7条回答
  •  遥遥无期
    2021-02-01 03:32

    For those who do not get a full month strong with "MMM", you can get it with

    dateFormatter.dateFormat = "dd MMMM yyyy"
    

    Tested on Swift 4.2

提交回复
热议问题