Monday, February 21, 2011

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

From stackoverflow
  • Use DATE_FORMAT()

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

0 comments:

Post a Comment