Is there a way to insert NOW() in a datetime format – “YYYY-MM-DD HH:MM:SS” in a column of the type “text”.
Currently I am using:
INSERT INTO table (mycol) VALUES (DATE(NOW()))
But this inserts the date in the format “YYYY-MM-DD”.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
use DATE_FORMAT()
Something like this,
or simple
SQLFIDDLE Demo