How to select date and time without the seconds in mysql?

前端 未结 3 553
你的背包
你的背包 2021-01-01 11:05

How do I select date and time without the seconds in mysql from a column with date value in a table ? \"YYYY-MM-DD HH:MM:SS\" should be \"YYYY-MM-DD HH:MM\"

3条回答
  •  囚心锁ツ
    2021-01-01 11:42

    SELECT DATE_FORMAT(`date`, '%Y-%m-%d %H:%i') AS `formatted_date` FROM `table`;
    

提交回复
热议问题