-3

I have date object like this "Tue Sep 02 2014 13:34:17 GMT+0500 (Pakistan Standard Time)" I want increment a day in the date object using node.js.

I.E.
     var myDate = "Tue Sep 02 2014 13:34:17 GMT+0500 (Pakistan Standard Time)";

please mention how to increment a day in above myDate.

Thanks

bilalmetla
  • 155
  • 12
  • possible duplicate of [Add day(s) to a Date object](http://stackoverflow.com/questions/6963311/add-days-to-a-date-object) – Stephen Sep 02 '14 at 09:37
  • I have tried this solution but in my case its giving me error. Error is getDate() method not found. – bilalmetla Sep 02 '14 at 10:02
  • This is my code which i am using. var dateStartedTemp = new Date(); dateStartedTemp = dateStartedTemp.setDate( dateStartedTemp.getDate+1); But its giving me error that getDate() method not found. – bilalmetla Sep 02 '14 at 10:32
  • And Above solution which you reffered is works in browser not in node.js – bilalmetla Sep 02 '14 at 10:34

1 Answers1

2

Try this

var myDate = new Date("Tue Sep 02 2014 13:34:17 GMT+0500 (Pakistan Standard Time)");
myDate.setDate(myDate.getDate() + 1);
alert(myDate);