I have a "date" column of type timestamp
in my table that is CURRENT_TIMESTAMP
(on update).
I retrieve it with PHP using: date('H:i a', strtotime($message->date)
But the time displayed is inconsistent for different database/server hosts (each has its own timezone).
Exampe of date format as shown in the database itself: 2018-05-06 20:20:22
What is the way to make the timestamp more general (perhaps unix time in seconds), and then in PHP retrieve it based on the user's timezone?
Will I have to change the INSERT
statement to explicitly insert a unix timestamp, or "CURRENT_TIMESTAMP" can do it too? (And then in PHP how to convert it)