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
Post a Comment