NSDateFormatter “Month” in 3 letters instead of full word

后端 未结 7 1363
一生所求
一生所求 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:17

    Actually you can set your dateStyle to medium (ie 'Jan', 'Feb' etc) like this:

    [formatter setDateStyle:NSDateFormatterMediumStyle];
    

提交回复
热议问题