PHP & mySQL: Year 2038 Bug: What is it? How to solve it?

前端 未结 6 1608
悲哀的现实
悲哀的现实 2020-11-22 16:37

I was thinking of using TIMESTAMP to store the date+time, but I read that there is a limitation of year 2038 on it. Instead of asking my question in bulk, I preferred to bre

6条回答
  •  失恋的感觉
    2020-11-22 17:08

    Bros, if you need to use PHP to display timestamps, this is the BEST PHP solution without changing from UNIX_TIMESTAMP format.

    Use a custom_date() function. Inside it, use the DateTime. Here's the DateTime solution.

    As long as you have UNSIGNED BIGINT(8) as your timestamps in database. As long as you have PHP 5.2.0 ++

提交回复
热议问题