如何将NSDate转换为Unix时间戳在Objective C / iPhone? [英] How to convert NSDate into Unix timestamp in Objective C/iPhone?
本文介绍了如何将NSDate转换为Unix时间戳在Objective C / iPhone?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Objective-C中将NSDate转换为Unix时间戳?
How can I convert an NSDate to a Unix timestamp in Objective-C?
推荐答案
我相信 - [NSDate timeIntervalSince1970]
是你想要的。 1970年1月1日是Unix纪元的日期。
I believe - [NSDate timeIntervalSince1970]
is what you want. Jan 1, 1970 is the date of the Unix epoch.
这篇关于如何将NSDate转换为Unix时间戳在Objective C / iPhone?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文