search

Home  >  Q&A  >  body text

iOS 应用里面对时区是怎么处理的?存到服务器时会先转化为UTC,还是直接存储中国时区的时间戳?

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

PHP中文网PHP中文网2809 days ago857

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 09:43:35

    Pass millisecond timestamp timeIntervalSince1970 * 1000

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

    reply
    0
  • ringa_lee

    ringa_lee2017-04-18 09:43:35

    If you meet users in other time zones, the time will be inaccurate. Previously, our server also stored the timestamp of Dongba District. We found that the time when the client was opened by users from other countries was biased; query, compare, and sort the stored timestamp data. It is more convenient; if you have time zone requirements, it is recommended to switch to UTC as soon as possible

    reply
    0
  • Cancelreply