I am working on a project and I was just curious if it was possible in JavaScript to call new Date() for a specific timezone. When I say:
var test = new Date();
I debug and I find that the var test =
Date {Fri Nov 07 2014 11:59:41 GMT-0500 (Eastern Standard Time)}
which makes sense because I am in the Eastern Time Zone and it is 11:59 here.
My questions is: Is there a way to get the Date object for a specified time zone, and not just your own local system time?
I have a reservation form where I am comparing the time entered for the start of a conference with the actual time is it now to make sure that the user doesn't enter a past time, or a time within 2 hours from the current time(different error validation messages get thrown up for each instance).
My only problem is that the person who fills out the form can be either in Eastern, Central, Mountain, or Pacific. So if a person located in Eastern Time fills out a form for a conference with a start time for a customer in Mountain time, when I try to compare the times, new Date() only gives me my local time, when I would want it to compare the time entered to Mountain time for my checks and validation.
Its sort of confusing but I just wanted to give you a little background on the application for this issue. If anyone needs further clarification please feel free to ask. Any help is greatly appreciated.
Thank you!
-Dave