My app will be run in Mexico and Australia.
When a user selects a date I format it as; "Friday 17 August 2012"
Now, how do I convert that string value into a UTC date?
So far I have this;
var enteredDate = $('.CreateDateRange').val() + " 07:00:00";
var thisDate = new Date(enteredDate);
var utcDate = new Date(thisDate.getUTCFullYear(), thisDate.getUTCMonth(), thisDate.getUTCDay(), thisDate.getUTCHours(), 0, 0);
But on the above date the returned date is; 2012 7 4 21:0:0 which is not correct.
From Australia I expect the UTC date to be something like "2012 8 17" or "2012 8 16" depending on time of day.
toUTCString? Please tryenteredDate.toString()andenteredDate.toUTCString()and check the timezone offsets. See the edited answer.