Im using AnyTime picker to get date and time (start date& time) in a format "%d/%m/%Y %H:%i:%s", im trying to get this input to be converted into a date object so that i could use getSeconds() to get the seconds and add a duration(in seconds) to get the end time and date.
How can i convert this input?
<input id="chooseTime" name="chooseTime" type="text" maxlength="16" size="20" value="">
var anytimeFormat = "%d/%m/%Y %H:%i:%s";
AnyTime.picker( "chooseTime", {
format: anytimeFormat,
firstDOW: 1
});
var schedule_start_time = new Date($("#chooseTime").val());
var schedule_end_time = new Date();
schedule_end_time.setSeconds(schedule_start_time.getSeconds() + durationInSecs);
Basically the problem is that the input is always the current date and time on my computer. The AnyTime picker input that i selected doesnt work. Did i did something wrongly. I have a feeling its the way im converting the chooseTime to a new Date. How can i do it, need some help!