私は、mysql、express、htmlと一緒にNode.jsを使用しています。node.jsの日付の形式を制限する
データベースから結果を取得しているときに、mysqlの型が日付であっても、 2016-03-16T00:00:00.000Z
の日付を取得します。
マイクエリ:
app.get('/list', function (req,res) {
connection.query('SELECT `ondate`,`projectname`,`hours` FROM `entries` WHERE YEARWEEK(`ondate`, 1) = YEARWEEK(CURDATE(), 1) ORDER BY ondate DESC ,projectname ASC ', function(err, rows, fields) {
res.json({error: err, result: rows});
});
})
は、私は時間を無視するondateフィールドを設定することができます方法はありますか?
はmysqlドライバーを使用していますか? –