converting timestamp to nsdate format

后端 未结 4 772
一个人的身影
一个人的身影 2020-12-08 13:21

I want to convert my timestamp value 1308031456 to NSDate format (which yields the value Tue, 14 Jun 2011 06:04:16 GMT in online web c

4条回答
  •  清歌不尽
    2020-12-08 13:58

    You can use the use the method dateWithTimeIntervalSince1970: to convert the timestamp you've which is the epoch time.

    NSDate * myDate = [NSDate dateWithTimeIntervalSince1970:1308031456];
    

提交回复
热议问题