Can't put a single quote before the year in NSDateFormatter

前端 未结 1 949
既然无缘
既然无缘 2021-01-11 14:53

I want to format my date as follows:

Mon, Apr 14 \'09

The dateFormat I\'m setting for my NSDateFormatter is

相关标签:
1条回答
  • 2021-01-11 15:37

    From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns:

    In patterns, two single quotes represents a literal single quote, …

    In your case:

     [formatter setDateFormat:@"EEE, MMM dd ''yy"];
    
    0 讨论(0)
提交回复
热议问题