im newbie in node js, i create a web use node js, i show date from database, but i want to change the format date
this.editNewEvent = function(req, res) {
var id = req.query.id;
// var start_date = ;
var dateFormat = require('dateFormat');
// var day_start = dateFormat(start_date, "dd/mm/yyyy");
connection.acquire(function(err, con) {
if (err) throw err;
con.query('SELECT id, event_code, event_name, id_type, event_category, description, start_date, end_date, location_name, longitude, latitude FROM transaksi_new_events WHERE id = "' + id + '" order by modified_at desc', function(err, rows) {
con.release();
if (err) {
console.log(err);
} else {
obj = JSON.parse(JSON.stringify(rows));
res.render('transaksi_new_event/edit', { obj: obj });
}
});
});
};
in my web the date show '2018-03-01T17:00:00.000Z' i want change format to dd/mm/yyyy
Aucun commentaire:
Enregistrer un commentaire