From (Twitter format example)
Tue, 15 May 2012 15:40:34 +0000
to (ISO format example)
2005-12-01T13:45:00
using XSLT
Here’s an XML snippet
<item>
<title>It's called "Kangaroo Care" - what parents can do to create a special bond and improve the health of their newborns: http://t.co/8MV8FpM4</title>
<link>http://twitter.com/ProvHealth/statuses/202423233104973826</link>
<description>It's called "Kangaroo Care" - what parents can do to create a special bond and improve the health of their newborns: <a href="http://t.co/8MV8FpM4">http://t.co/8MV8FpM4</a></description>
<pubDate>Tue, 15 May 2012 15:40:34 +0000</pubDate>
<guid>http://twitter.com/ProvHealth/statuses/202423233104973826</guid>
<author>ProvHealth@twitter.com (Providence Oregon)</author>
<media:content type="image/jpg" height="48" width="48" url="http://a0.twimg.com/profile_images/748948431/cross_normal.png"/>
<google:image_link>http://a0.twimg.com/profile_images/748948431/cross_normal.png</google:image_link>
<twitter:metadata>
<twitter:result_type>recent</twitter:result_type>
</twitter:metadata>
</item>
Here’s some ideas about how to approach this.
you can do substring wrangling like in this example:
Format a date in XML via XSLT.
You will likely have to create yourself a few “enumerables” for
days of the week and months.
XPath 2.0 gives you XSD types constructor functions and
you can get some help from these on top of substring wrangling.
if your transformer supports EXSLT you can go with the
date/time extension functions.
EXSLT also has regular expression support which you can
use to parse the twitter date into chunks for further conversion
into the ISO date.
you can write a custom extension function in whatever
technology you use to drive your XSLT to run the conversion for you.
With that said, there’s no one-function “easy” way to accomplish what you need in XSLT.