javascript - MySQL: date format changed when retrieving it by node.js -
i have made table personal information dob "date" type. when select entire table in terminal, shows correct format(yyyy-mm-dd). however, when created connection through node.js , output console, printed json object dob has hh-mm-ss behind actual date?
for example 1 of column has dob "1996-03-06". however, when passed node.js server , printe console log, became "1996-03-0605:00:00.000z"
what more strange when send information ajax print web, output this: wed mar 06 1996 00:00:00 gmt-0500 (est), different both actual data , data shown in console
just print or send in ajax whatever need date
object
console.log(dob.toisostring().slice(0,10))
wiki
Comments
Post a Comment