Converting JSON date(ticks) to NSDate

后端 未结 4 1859
误落风尘
误落风尘 2021-01-21 08:34

Does anyone know how to convert a JSON date(ticks) to an NSDate in Objective-C? Can someone post some code?

4条回答
  •  一向
    一向 (楼主)
    2021-01-21 09:10

    According to this page: http://msdn.microsoft.com/en-us/library/system.datetime.ticks.aspx ticks begin on Jan 1, 0001 so dateWithTimeIntervalSince1970: is not automatically setup to work with ticks. You can still use this method but should adjust for the difference.

提交回复
热议问题