MySQL Forums
Forum List  »  General

Re: Is it ok to insert NOW() into a VARCHAR column?
Posted by: Anne-Marie Matula
Date: December 17, 2018 04:13PM

Hi,

I am sure you have what you need by now, but thought to respond to the thread anyway.

You can convert it to a string in the format you want/need it, for instance, for mm/dd/yyyy:

DATE_FORMAT(NOW(),'%m/%d/%Y')

https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format

All the best!

Options: ReplyQuote


Subject
Written By
Posted
Re: Is it ok to insert NOW() into a VARCHAR column?
December 17, 2018 04:13PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.