Great, thank you for the response, it was helpful to get a few pointers to
look more information up. I have also found the below helpful article later:

http://developer.marklogic.com/learn/2004-09-dates

though it made me wonder why the colon at position 22 is even necessary, as
without the colon, it is still confirming (notice that there seems to be a
typo in the format used, as it should be needing a "Z" at the end (as in
"yyyy-MM-dd'T'HH:mm:ssZ")).

-- Hari

On Fri, Dec 17, 2010 at 6:08 AM, <[email protected]>wrote:

> Date: Thu, 16 Dec 2010 17:29:34 -0800
> From: Jason Hunter <[email protected]>
> Subject: Re: [MarkLogic Dev General] Storing date and time
> To: General MarkLogic Developer Discussion
>        <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Hari,
>
> Easiest way is to use the standard ISO dateTime format and add a "range
> index" on the QName.  Then you can use cts:element-range-query() to quickly
> search ranges of dates, or cts:element-values() or
> cts:element-value-ranges() to get analytics.  The ISO dates are time zone
> aware, though time zones are hairy business.  Make sure on your range index
> you specify the data type.
>
> Use current-dateTime() to get a sample of what an xs:dateTime looks like.
>
> -jh-
>
> On Dec 16, 2010, at 5:19 PM, Hari Krishna Dara wrote:
>
> > I am new to MarkLogic and XQuery and wondering how to store date and time
> such that it can be easily searched against. E.g., I would like to find all
> the documents with a datetime that is less than a given value. I noticed
> that XPath has xs:dateTime() constructor given a date and a time, so are we
> supposed to split the datetime into date and time parts and store as two
> elements? What about timezone information? Is it better to convert to
> something like GMT and ignore it altogether in the query?
> >
> > Thank you,
> > Hari
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to