I'm trying to convert a timestamp being returned from a JSON resource in javascript that is displaying in UTC to the users local timezone. Below i'm trying to adjust with the user offset.
Example UTC output for date: Tue Mar 27 2012 02:29:15 GMT-0400 (EDT)
Code
var date = new Date(data.date_created); //Data.date_created coming from json payload
var offset = date.getTimezoneOffset() //Get offset
var new_date = new Date(date offset); //Add offset to userdate
I'm struggling with the appropriate method to achieve this. Can anyone point me in the right direction?