Share
ShareSidebar
2011-11-27 10:22:42 +0

how to set default current time in mysql's column?

i need the correct format for inserting the current time into MySQL

Rate this post

You must be registered to vote first

Comments

jzentt
jzentt 2011-11-27 10:38:39

Use TIMESTAMP, and CURRENT_TIMESTAMP by default

ALTER TABLE `sample` ADD COLUMN `current_date` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+1

Comment