akburan akburan - 4 years ago 183
MySQL Question

MySQL Workbench: Can't apply NOW() to timestamps field

I get this problem with applying now() to timestamp field. It just doesn't automatically fill in the field with the current time. I tried both now() and NOW() and also current_time, doesn't work either. What can be the problem? What other values I can insert into the field in order to get the current time?
enter image description here

enter image description here

Answer Source

Use now() in query without quotes:

Insert into blog.task(body,created_at ,updated_at)values('some values',now(),now());
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download