Is it possible to convert strings like 30042013
(30 April 2013) to a date format?
So I can use it later in functions like format-date
Is it possible to convert strings like 30042013
(30 April 2013) to a date format?
So I can use it later in functions like format-date
fn:dateTime($arg1 as xs:date?, $arg2 as xs:time?)
will convert its arguments toxs:dateTime
.Just use
fn:substring()
andfn:concat()
to cut out the relevant parts and join them asyyyy-mm-dd
before passing that tofn:dateTime
.Like Tomalak said, you can use
substring()
andconcat()
to build a string you can cast as anxs:date()
(It doesn't sound like you want a dateTime.)Example:
produces (with any XML input)