Edit Default Value, timestamp
Moderator: General Moderators
Edit Default Value, timestamp
My timestamp returns date in this format 20080823235029. I would like in CURRENT_TIMESTAMP format. I noticed that my Default value is NULL. I already have bunch of post related to that date. Can somebody give me a command to change my Default value to CURRENT_TIMESTAMP with out changing any other table values.
Re: Edit Default Value, timestamp
Use mysql's DATE_FORMAT() function.. eg
Code: Select all
SELECT DATE_FORMAT(`table`.`timestamp_column`, "%Y-%m-%d %H:%i:%s") AS timestamp_formatted FROM `table`