I have node JS error for date function what someting wrong?

I have some error about new date(); i use node js and plug-in express npm i build variable date but something wrong compile is error

this is my code .js

     var update_time = new Date();
     update_time.formatDate("y/m/d");

And i run node this is error

/home/kingdark/Repos/api/epg/node_modules/xml2js/lib/xml2js.js:216
          throw ex;
                ^
TypeError: Object Fri Feb 08 2013 14:33:09 GMT+0700 (ICT) has no method 'formatDate'
    at /home/kingdark/Repos/api/epg/src/sync/epg.js:24:22
    at Parser.exports.Parser.Parser.parseString (/home/kingdark/Repos/api/epg/node_modules/xml2js/lib/xml2js.js:199:18)
    at Parser.EventEmitter.emit (events.js:96:17)
    at Object.exports.Parser.Parser.reset.saxParser.onclosetag (/home/kingdark/Repos/api/epg/node_modules/xml2js/lib/xml2js.js:183:24)
    at emit (/home/kingdark/Repos/api/epg/node_modules/xml2js/node_modules/sax/lib/sax.js:589:33)
    at emitNode (/home/kingdark/Repos/api/epg/node_modules/xml2js/node_modules/sax/lib/sax.js:594:3)
    at closeTag (/home/kingdark/Repos/api/epg/node_modules/xml2js/node_modules/sax/lib/sax.js:834:5)
    at Object.write (/home/kingdark/Repos/api/epg/node_modules/xml2js/node_modules/sax/lib/sax.js:1253:29)
    at Parser.exports.Parser.Parser.parseString (/home/kingdark/Repos/api/epg/node_modules/xml2js/lib/xml2js.js:211:31)
    at Parser.__bind [as parseString] (/home/kingdark/Repos/api/epg/node_modules/xml2js/lib/xml2js.js:6:61)
    at /home/kingdark/Repos/api/epg/src/sync/epg.js:16:15

How to fix that maybe my syntax is wrong,sorry for my English skill.

There is no build in method 'formatDate' however you can use something like node-dateformat

var now = new Date();

dateFormat(now, "yyyy/mm/dd");

As the first line of the error message shows: Object ... has no method 'formatDate'. The Date object in JavaScript does not have format functions like you are trying. Check out the accepted answers to this question.

There is no function like formatdate() for Date Objects in JavaScripts...

So just try like below... it will help you....

var d = new Date();
var FormattedDate = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
alert(FormattedDate);