views:

38

answers:

2

What time format is this and how can I reformat it using JQuery? It's from a pubdate from an podcast XML.

Mon, 26 Jul 2010 19:15:58 -0700

Is there a precise name for this date format? I haven't seen this exact one anywhere and it's baffling me a bit. I've tried the plugin listed below but it doesn't work correctly or take this date input.

A: 

You'll need a plugin. A quick search pulled up http://plugins.jquery.com/project/jquery-dateFormat

Galen
Thanks. Yeah I tried that one, but it doesn't format it correctly.That plugin only takes these input types:input dates formats#1 2009-12-18 10:54:50.546#2 Wed Jan 13 10:43:41 CET 2010That's why I wanted to know the specific date format type, so I can be more specific. Unless you see that I'm doing something wrong.http://plugins.jquery.com/project/jquery-dateFormat
B-Money
Using that plugin, my date begins as this:<pubDate>Mon, 09 Aug 2010 19:00:36 -0700</pubDate>I put it through that formatter and it comes out like this:09/Aug/-0700
B-Money
A: 

JS understands that format :

javascript:alert(new Date(Date.parse('Mon, 26 Jul 2010 19:15:58 -0700')))
mplungjan
Hot dang, you were right! Thank you! Here's what I had to do in order to get it in the format I wanted. 1) Parse the date like MPLUNGJAN said 2) Then slap it through that formatter like so.var cleanDate = (new Date(Date.parse(item.pubDate))); $('#storyDate').empty().append($.format.date(cleanDate, "MM/dd/yyyy"));
B-Money
glad to help. JS still has a few built-in surprises like that :-)
mplungjan