consider am having the string date and time.
say
var selfwDepDate = document.forms[0].fwDepartureDate.value;
var selfwDepTime = document.forms[0].fwDepartureTime.value;
and having time zone as
var orgTimeZone = document.getElementById('orginTimeZone').value;
var descTimeZone = document.getElementById('descTimeZone').value;
can any one how to convert the String date to GMT date..
value of orgTimeZone = Asia/Dubai
value of descTimeZone = America/New_York
I think you can use timezone-js.
Create a timezoneJS.Date the same way as a normal JavaScript Date,
but append a timezone parameter on the end:
OR
you can approach like this:-
Now for different timezone you need to add or subtract the time by which they differ from GMT.
Note :-Date.UTC() returns the number of milliseconds since the epoch, UTC.