Hi Chrissie,
The types are just xml types, so anything that is a valid xml date (or
whichever type you want) will work as an element value for a range index.
To know if the value will work, you can do a cast to that type. For example,
"2009-07-01" is a valid date because the following returns a value:
xs:date("2009-07-01")
"2009-13-01" is not valid because the following returns an exception:
xs:date("2009-13-01")
[1.0-ml] XDMP-CAST: (err:FORG0001) xs:date("2009-13-01") -- Invalid cast:
"2009-13-01" cast as xs:date
Here is a dateTime example:
xs:dateTime("2009-07-01T15:53:14.187-07:00")
I find the Context F&Os help me to figure out the formats, as these return
various time-based datatypes:
http://developer.marklogic.com/pubs/4.1/apidocs/ContextBuiltins.html
fn:current-date()
fn:current-dateTime()
fn:current-time( )
XML date formats are quite fussy, though, and there are a ton of xquery
functions to help deal with them.
-Danny
From: [email protected]
[mailto:[email protected]] On Behalf Of Childers,
Chrissie N
Sent: Wednesday, July 01, 2009 2:33 PM
To: [email protected]
Subject: [MarkLogic Dev General] Date, Datetime, and time formats for element
range indexes
Hi, I am trying to use the element range indexes and am wondering what the
required formats are for the date, datetime, and time datatypes, i.e. YYYY-MM-DD
Thank you!
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general