I have a simple blog table with a field "date" of type current timestamp so in the database it shows as 2019-10-09 01:37:12 when I display the date with a simple query
connection.query('SELECT * FROM `soccer`', function (error, results, fields) {
console.log(results)
res.render("index.ejs", {
results: results
});
});
});
I get the date displayed as Sun Oct 06 2019 00:00:00 GMT+0200 (GMT+02:00)
what I would like is the date in format dd/mm/yyyy so I wonder the best way to do this formatting either directly in the mysql query (if the DB can do that way not) or in javascript once I get the results. Thanks