[MarkLogic Dev General] Querying DateTime values

Kari Cowan kcowan at alm.com
Fri Sep 22 07:51:59 PDT 2017

I need some expert tips on this bug.

">=", xs:dateTime(fn:current-date() - xs:dayTimeDuration("P30D")))

The above query works fine when the publication-date is in this format:
<PUBLICATION-DATE date="2017-09-28"

But it fails when
<PUBLICATION-DATE date="2003-08-01"

The datetime format is different, but if I manipulate the current-date to
match that format, the query will fail with this message:

[1.0-ml] XDMP-EXPR: (err:XPTY0004) "2017-09-22T08:00:00Z" -
xs:dayTimeDuration("P30D") -- Invalid expression

How would I write the query to properly compare the dates?

The goal above was to return content from the last 30 days.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20170922/b92cf1bf/attachment.html 

More information about the General mailing list