Answer the question
In order to leave comments, you need to log in
How to save timestamp from php to MySQL?
I'm trying to send data to the database as a timestamp from PHP, but it always gives me an error:
Incorrect datetime value: '1526763600' for column 'expiration_date' at row 1
Answer the question
In order to leave comments, you need to log in
Use the FROM_UNIXTIME function to convert input parameters to the timestamp data type:
Checking the result:
SELECT UNIX_TIMESTAMP(expiration_date) FROM you_table
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question