best way to change the date format in mysql SELECT?

前端 未结 4 1207
不知归路
不知归路 2021-01-02 15:47

Can any one please let me know, i need to change the data format 2010-05-14 17:53 to 14/05/2010 17:53 using mysql select query

4条回答
  •  天涯浪人
    2021-01-02 16:38

    Maybe this link might help you MySQL Manuel

    This should do the trick :

    Select DATE_FORMAT(now(),'%d/%m/%Y %H:%i');
    

    For hour, u can use %H or %h, depending if you want 24h or 12h display. %H will set 24h, %h will set 12h.

提交回复
热议问题