changing time format in node js
Here I am fetching the date stored in the database in format(2013-08-17
07:50:21), I am getting the below output, But I need the date in format
like 17 August 2013 without using any third party module. Is it possible?
If yes suggest the solution.
var sql2 ="SELECT `user_id`, `vote_date` FROM `tb_post_votes` WHERE
`post_id`=?";
connection.query(sql2,[postId],function(err, result) {
var post={"user_id":result[0].user_id,"date":result[0].vote_date});
res.send(JSON.stringify(post));
});
Output: {"user_id":11,"date":"2013-08-17T07:50:21.000Z"}
No comments:
Post a Comment