Khilen Khilen - 3 months ago 9
MySQL Question

Convert DateTime Value into String in Mysql

I want to convert Date & time value into varchar and then store in database

I am fetching the Current Date & time using NOW() in mysql and now want to convert it in string because i have to merge this value with String value

Answer

Use DATE_FORMAT()

SELECT
  DATE_FORMAT(NOW(), '%d %m %Y') AS your_date;