[xquery-talk] fn to convert rss2.0 date/time string to xs:dateTime

Andrew Welch andrew.j.welch at gmail.com
Tue Jul 5 12:02:54 PDT 2011


On 5 July 2011 19:45, Gary Lewis <gary.m.lewis at gmail.com> wrote:
> RSS2.0 feeds return pubDate in the following form:
>
> Tue, 28 Jun 2011 17:26:20 zzz
>
> where zzz can be expressed as a timezone (eg, PDT) or a local differential
> from UTC (eg, +0000).
>
> To my knowledge there is no to_date() function in XQuery that would convert
> a formatted xs:string into an xs:dateTime based on some pattern match (eg,
> to_date("Tue, 28 Jun 2011 17:26:20 +0000", "Dy, dd Mon yyyy hh24:mm:ss
> +HHMM") would produce:
>
> 2011-06-28T17:26:20+00:00

Which xquery processor are you using?

If it's eXist there is:
http://demo.exist-db.org/exist/functions/datetime/parse-date


-- 
Andrew Welch
http://andrewjwelch.com


More information about the talk mailing list