Home  >  Q&A  >  body text

mysql - Regarding the issue of time storage, do you guys use the local time or UTC time when you save the database time?

As the title states, there is a question about time storage. When you store the time in the database, do you use the local time or the UTC world time?

伊谢尔伦伊谢尔伦2683 days ago1226

reply all(4)I'll reply

  • 扔个三星炸死你

    扔个三星炸死你2017-06-15 09:23:15

    Save the timestamp, what if you want world time? →_→

    reply
    0
  • 世界只因有你

    世界只因有你2017-06-15 09:23:15

    Of course, take the UTC world time in East 8th District

    reply
    0
  • 習慣沉默

    習慣沉默2017-06-15 09:23:15

    Of course it’s UTC time

    reply
    0
  • 学习ing

    学习ing2017-06-15 09:23:15

    Certainly cannot use database time. For example, you click a button on the page to save a piece of data into the database. There may be some reasons for this process. The time you clicked is 12:00, but the time when the data is saved is 12:01. In this case, the data is wrong. It is said above that getting the timestamp is very reliable. When you click, the timestamp will be put into the data. As for when the database saves it, it doesn't matter. Anyway, the corresponding timestamp is saved at 12:00, and it will always be 12:00 whenever you view it.

    reply
    0
  • Cancelreply