I retrieved a datetime value from a mysql datebase (a 'datetime' column value), and after retrieving it via an ajax call, when I created the Date object, it considered the datetime to be in EST time. But in the DB its stored in GMT time. How can I get javascript to consider the value as GMT time?
Here's my code:
timestamp = new Date(data[i].startTime);
alert(timestamp.getTime());
The alert shows the same exact time, but considers it in local time (EST). IE: If data[i].startTime reads as "2012-11-27 09:05:18"
, then the alert reports 1354025118.
This number of milliseconds though refers to 2012-11-27 09:05:18 GMT-0500
(or 2012-11-27 14:05:18
)