Add 2hours to datetime-string in javascript -


i following string webservice, 2014-06-05t10:27:47z. want add 2hours this.

i tried convert date , add time, doesn't work. code below:

var d = new date("2014-06-05t10:27:47z"); d = new date(d + 2*60*60*1000); 

what doing wrong?

use sethours , gethours methods of date object instead of trying yourself.

var d = new date("2014-06-05t10:27:47z");  d.sethours(d.gethours() + 2) 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -