NSDateFormatter difference

后端 未结 2 1749
日久生厌
日久生厌 2021-01-27 18:06

What is the difference between these two Date Formats. First one give actual time but second on give time buy adding time zone offset value.

NSDateFormatter * d         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-27 18:39

    The second date formatter is incorrect, the 'Z' should not be single quoted, that keeps it from being considered a format character.

    Also the only single quotes that are needed are around the 'T' so that is is not considered a format character but rather a literal.

    See ICU User Guide: Formatting Dates and Times

提交回复
热议问题