String formatted date picker date is off

后端 未结 1 866
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-16 07:39

I have a UIDatePicker that only has month, day, and year. I am trying to output this selected date to a TextField using this code:

-(IBAction) dateChanged:(         


        
1条回答
  •  失恋的感觉
    2020-12-16 08:20

    Use lowercase yyyy for the year.

    Uppercase YYYY returns the year of the start of the week that date falls in.
    See Unicode Date Format Patterns.

    0 讨论(0)
提交回复
热议问题