Skip to content
Advertisement

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

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”

Advertisement

Answer

SELECT DATE_FORMAT(`date`, '%Y-%m-%d %H:%i') AS `formatted_date` FROM `table`;
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement