Possible Duplicate:
Formatting a date in javascript
I am new to Javascript / JQuery...and right now all I am trying to do (to learn) is to make a page that extracts information from a google calendar (public) and displays the events along with start date + time plus end date and time. So far I have:
<script type="text/javascript">
$(document).ready(function () {
var baseURL = "https://www.googleapis.com/calendar/v3/calendars/qq3hkhn3dj8gt05q539smmk2go@group.calendar.google.com/events?key=AIzaSyB66zMow3CSeTdM1m_X_0Wj1JxCtSTd8kU&alt=json&callback=?";
$.ajax({
url: baseURL,
dataType: 'json',
success: function(result) {
console.log(result.items[0].created);
}
});
});
</script>
In my console, the output I see is:
2012-01-07T23:46:15.000Z
Now, what I want to do is, parse this date and time into a pretty looking string, something like "January 1, 2012" and same for the time. How should I proceed? I do not want to step outside JS / JQuery / AJAX.
Also, I would appreciate comments / feedback on my code so far - does this seem a normal / good way to do it, or should I approach it differently?
Thanks, let me know please!