node.js - Date Query MySQL -


i want make query select row table...

the query : select date dbuser;

+------------+ | date       | +------------+ | 2015-05-28 | | 2015-05-29 | | 1994-11-11 | | 2010-01-01 | | 2003-04-30 | +------------+ 

but output it's not same:

{ date: thu may 28 2015 00:00:00 gmt+0200 (romance summer time) } { date: fri may 29 2015 00:00:00 gmt+0200 (romance summer time) } { date: fri nov 11 1994 00:00:00 gmt+0100 (romance standard time) } { date: fri jan 01 2010 00:00:00 gmt+0100 (romance standard time) } { date: wed apr 30 2003 00:00:00 gmt+0200 (romance summer time) } 

i want output table yyyy-dd-mm:

2015-05-28  2015-05-29 1994-11-11 2010-01-01 2003-04-30  

my code:

 app.get('/admin', function(req, res){   connection.query("select date dbsuer", function(err, results) {     if (err) throw err;      console.log(results);     res.send(results);   }); }); 

im using nodejs server side !

  app.get('/admin', function(req, res){   connection.query("select date_format(date,'%y/%m/%d') date dbsuer", function(err, results) {     if (err) throw err;      console.log(results);     res.send(results);   }); }); 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -