iOS 应用里面对时区是怎么处理的?存到服务器时会先转化为UTC,还是直接存储中国时区的时间戳?
PHP中文网
PHP中文网 2017-04-18 09:41:35
0
2
793

因为目前我们应用里面存储和解析都用的中国时区的时间戳来存储,目前使用过程中也没有问题,不知道有没有必要转化为UTC再存储,目前会有什么问题?

PHP中文网
PHP中文网

认证高级PHP讲师

Antworte allen(2)
Ty80

传毫秒时间戳 timeIntervalSince1970 * 1000

timeIntervalSince1970
The interval between the date object and 00:00:00 UTC on 1 January 1970.

左手右手慢动作

遇到别的时区用户的话,时间就会不准,之前我们服务器也是存的东八区的时间戳,发现别的国家用户客户端打开的时间有偏差;存时间戳数据查询,比较,排序比较方便;如果有时区方面的需求,建议尽早转utc

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!