I am trying to set a column on Phpmyadmin to just “TIME”. How can I set the default value to the current time? Only time, no date included.
CURRENT_TIMESTAMP does not work, I also have tried now() but no success. I have looked on the documentation but haven’t found anything specific about it.
3
Answers
It’s not possible to set a default value for a TIME or DATE column. Switch to a TIMESTAMP column and use
date(t_stamp)
to just get the date. Ortime(t_stamp)
to just get the time.Excerpts from the documentation link in the question:
So, when supported, use parenthesis:
Demo