Convert UTC Epoch to local date
Here is the simple solution,
Take the epoch as a initial date and add UTC units. Say you have a UTC epoch var stored in seconds. How about 1234567890. In the local time zone to convert that to a proper date .
var utcSeconds = 1234567890; var d = new Date(0); // The 0 there is the key, which sets the date to the epoch d.setUTCSeconds(utcSeconds);
d is now a date (in my time zone) set to Fri Feb 13 2009 18:31:30 GMT-0500 (EST)