Lets say that I am bringing in a JSON feed that has a field with a time value like this in ISO:
2010-11-17T15:02:23-08:00
Now when I bring in the JSON feed through jQuery, I want to convert that to a readable time through JSON2.js. I looked around and even Resig suggested to use JSON2.js for this sort of thing.
Other methods I tried gave me a NaN error in IE8 and Invalid Date in Google Chrome and Wed Nov 17 2010 15:02:23 GMT-0800 (Pacific Standard Time) in Firefox 3.6.12 with this code:
var isodate = '2010-11-17T15:02:23-08:00';
var dconvert = new Date(JSON.parse(JSON.stringify(new Date(isodate))));
What I basically want to do is take that and put into a format like
[B]November 11th, 2010 X:XX PM
[/B]So is this pretty easy to implement? If jQuery has a built in feature better than JSON2.js (please, no plugins to keep it light), let me know the best way.
Thanks!