Skip to content
Advertisement

How to neglect timestamps when inserting date to MySQL database

I want to insert a date into MySQL table. But, even if I use strftime(), the timestamps are showing like 00:00:00. How can I get rid of it?

Output:

Advertisement

Answer

Obviously the column Date has data type DATETIME or TIMESTAMP.
If you don’t need the time part of the column, you should change the data type to DATE:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement