Converting String value to Date and adding 200 minutes in javascript -
i have string date value returned database. date ="2015-06-26 13:23:04"
. how add 200 minutes
in javascript? not able convert date. want same format.
i want dispaly same format "2015-06-26 13:23:04".
i used below code convert.
var datevar = "2015-06-26 13:23:04"; var today = new date(datevar).toisostring().slice(0, 20);
and cant correct hh:mm:ss value.
getting : "2015-06-26to7:53:04"
please me. thank you.
if sure string that, can transform milliseconds , add 20*60*1000 corresponds 20minuts
var yourstring= "2015-06-26 13:23:04", year=yourstring.substring(0,4), month=yourstring.substring(5,7), day=yourstring.substring(8,10), hour=yourstring.substring(11,13), minuts=yourstring.substring(14,16), secondes=yourstring.substring(17,19), mkdate= new date(year,month,day,hour,minuts,secondes), add200minutes =mkdate.gettime() + 200*60*1000, newdate=new date(add200minutes); alert(newdate);
Comments
Post a Comment