convert epoch time to NSDate in cocoa/iPhone

后端 未结 2 1161
失恋的感觉
失恋的感觉 2021-02-07 08:46

I have the value of the epoch time like say 123456789, now I want to convert this into NSDate in cocoa framework. Can anyone show me?

thanks

2条回答
  •  面向向阳花
    2021-02-07 09:16

    Documentation is your friend!

    NSDate* date = [NSDate dateWithTimeIntervalSince1970:123456789];
    

提交回复
热议问题