Add 2 Hours with current time


#1

Hi,
I want to Add 2 hours with current time.Or Get after 2 hours time for booking purpose.How it will be? Please help

Regards


#2

Hi friend.

I suggest you Moment.js.


#3

Hai
@quicoli but i cant see that.i need booing so need to get after 2 hours from current time should not be book previos time na


#4

Is there technic using min in angularjs?


#5

Here my friend:

var timestring1 = “2015-06-26T00:00:00Z”; //here you could get current datetime…
var timestring2 = “2015-06-26T02:00:00Z”;
var startdate = moment(timestring1);
var expected_enddate = moment(timestring2);
var returned_endate = moment(startdate).add(2, ‘hours’); // see the cloning?
returned_endate.isSame(expected_enddate) // true


#6

Thanks Dear
I wil check it out :blush:


#7

Hello
@quicoli now i didnt got the html part
this is what iam given

 <input type="text" class="startdate" />
    <input type="text" class="timestring1" /> to
    <input type="text" class="timestring2" />
    <input type="text" class="expected_enddate" />

:cry: