A hopefully useful note for anyone in the situation where they need to convert from UNIX time to an XML dateTime()
First, to get a timestamp:
Which should return something like:
In cq/DQ, declare the following function:
Which can be run like so:
And should give you:
The XQuery code was taken (and updated for 1.0-ml) from this module: http://github.com/marklogic/cq/blob/master/lib-xquery.xqy.
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2010
(43)
-
▼
June
(8)
- XQDT: Notes for installing the current Milestone o...
- MarkLogic: XQuery: performance with Maps
- Java: Using Jersey with JAXB to output XML or JSON.
- MarkLogic: XQuery: hacking the position() - a basi...
- MarkLogic: XQuery: and / and-not query examples
- MarkLogic: XQuery: UNIX Timestamp to xs:dateTime C...
- MarkLogic: XCC/J: Passing a node() into a Query as...
- MarkLogic: XQuery: Typeswitching based on input "t...
-
▼
June
(8)
1 comment:
Thanks mate, it was helpful!
Post a Comment