【问题标题】:How can i get the current time-stamp in iOS programmatically?如何以编程方式获取 iOS 中的当前时间戳?
【发布时间】:2014-09-04 10:47:42
【问题描述】:

如何以编程方式获取 iOS 中的当前时间戳?

请告诉我语法。

【问题讨论】:

  • 并定义'timestamp'

标签: ios timestamp


【解决方案1】:

以编程方式调用该方法,1000是将时间戳转换为毫秒

- (NSString *) timeStamp {
    return [NSString stringWithFormat:@"%f",[[NSDate date] timeIntervalSince1970] * 1000];
}

【讨论】:

    猜你喜欢
    • 2014-04-17
    • 1970-01-01
    • 2011-02-16
    • 1970-01-01
    • 1970-01-01
    • 2021-12-04
    • 1970-01-01
    • 2011-03-16
    相关资源
    最近更新 更多