如何将NSDate转换为unix时间戳iphone sdk? [英] How to convert NSDate into unix timestamp iphone sdk?

查看:148
本文介绍了如何将NSDate转换为unix时间戳iphone sdk?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 NSDate 转换为Unix时间戳?我读了很多相反的帖子。但我找不到与我的问题有关的任何内容。

How to convert an NSDate into Unix timestamp? I've read many posts which do the reverse. But I'm not finding anything related to my question.

推荐答案

我相信这是你正在寻找的NSDate的选择器:

I believe this is the NSDate's selector you're looking for:

- (NSTimeInterval)timeIntervalSince1970

这篇关于如何将NSDate转换为unix时间戳iphone sdk?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆