I would like to add 30 minutes to this date format:
"Mon Sep 11 2017 12:00:00 GMT+0200 (CEST)"
I've made a function that works with the ISO 8601:
add30mnTo(date : string){
var initialdate = (this.datetotimestamp(date) + 1800) * 1000; // 1800 for 30min
var dateinit = new Date (initialdate)
var result = dateinit.toISOString();
alert(result);
return result;
}
datetotimestamp(date : string){
var myDate = new Date(date);
var withOffset = (myDate.getTime())/1000;
return withOffset ;
}
But I don't know how I can modify it to work the full text string format