我使用谓词编辑器进行过滤并将结果保存到mysql。 日期将被保存(今天)为:316077618.500794
我的问题: 我如何在 PHP 时间内计算这个?我想将此日期作为 Realdate 回显,但我找不到如何为 php 计算此日期。
我无法在cocoa代码中修改,它必须在PHP中格式化。
我需要帮助:)
非常感谢。
最佳答案
NSDate Reference告诉我:
The sole primitive method of NSDate, timeIntervalSinceReferenceDate, provides the basis for all the other methods in the NSDate interface. This method returns a time value relative to an absolute reference date—the first instant of 1 January 2001, GMT.
您有 2 个选择:
- 修改您的 cocoa 代码,以熟悉的格式导出日期。 (是的,这可能不是一个选择,但老实说它是最简单的)
- 自己计算一下。这其中存在危险,因为您必须确保不会弄乱时区。最简单的是 978307200 + NSDate。
关于php - NSDate 和 PHP 回显,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4711286/