View Full Version : Convert time to UTC time

12-09-2011, 05:14 PM
Hi - I have a date in my javascript like this:

Mon Dec 12 00:00:00 UTC+0430 2011

I need to convert it to a date without the offset (the +0430).

I actually changed my computer's timezone to generate this offset - we have uses placing orders on our site who don't use UTC and it's throwing our orders out as they need to select a delivery date but it's passing the date with the offset.

How do I convert a date to UTC time?


12-09-2011, 05:43 PM
There are multiple methods to convert a date into UTC representation.
See the Date object methods (https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date#Methods_2) which have "UTC" in their names.