utc to est javascript 1

utc to est javascript

var tmpDate = new Date("Fri Jul 21 02:00:00 GMT 2012")
alert(tmpDate);
//Result: Fri Jul 20 22:00:00 EDT 2012

Here is what the above code is Doing:
1. Create a new Date object with the date string “Fri Jul 21 02:00:00 GMT 2012”
2. The Date object is created in the local timezone, which is EDT.
3. The Date object is then converted to a string, which is displayed in the alert.

Similar Posts