I am using the mysql npm package with my Nodejs server. I have a datetime
field that I want to display without time but I do not want to convert the data type to date
So I did
select cast(dateReached as date) as date
Now if I run this in mysql workbench, I get the properly converted value. However, doing this using mysql package does not convert the datetime to time
pool.query("select cast(dateReached as date) as date",function(err,rows,fields){
console.log(rows)
//
})
Returns
RowDataPacket { Date: 2019-06-26T04:00:00.000Z }
Is there a way to cast date using the mysql package?