light9
9/11/2013 - 10:07 AM

From http://stackoverflow.com/questions/847185/convert-a-unix-timestamp-to-time-in-javascript // create a new javascript Date object based o

From http://stackoverflow.com/questions/847185/convert-a-unix-timestamp-to-time-in-javascript // create a new javascript Date object based on the timestamp

var s = 1378897200; // unix timestamp
var theDate = new Date(s*1000);
//dateString = theDate.toLocaleString(); 
var year = theDate.getFullYear();
var month = theDate.getMonth() + 1;
var day = theDate.getDate();
var hours = theDate.getHours();
var minutes = theDate.getMinutes();
var seconds = theDate.getSeconds();