I have a date string that looks like the following javascript format. I want to convert this to a date object and add one minute.
timeObject = "Mon Nov 07 2011 06:41:48 GMT-0500 (Eastern Standard Time)";
timeObject.setSeconds(timeObject.getSeconds() + 60);
====== SOLUTION ==========
never mind. I got it...
var time = $('#myDiv').val(); // = "Mon Nov 07 2011 06:41:48 GMT-0500 (Eastern Standard Time)";
var timeObject = new Date(time);
alert(timeObject);
timeObject.setSeconds(timeObject.getSeconds() + 60);
alert(timeObject);
Proper way is:
timeObject.setTime(timeObject.getTime() + 1000 * 60);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With