[XQZone General] convert date into marklogic date

McBeath, Darin W (ELS-AMS) D.McBeath at elsevier.com
Wed Jul 13 11:43:08 PDT 2005


One approach (I assume there are many others) could be to do something like
the following ... essentially subtract date A from date B.

So, it would look like this.

subtract-dateTimes-yielding-dayTimeDuration(
  xs:dateTime('2005-07-12T18:14:21.236-07:00'),
  xs:dateTime('2005-07-12T18:14:30.971-07:00'))

would generate a response of

-PT9.735S

Indicating (because of the '-') that the first date is less than the second
date.

If you reversed the two dates, you would generate a response of

PT9.735S

Darin.

-----Original Message-----
From: general-bounces at xqzone.marklogic.com
[mailto:general-bounces at xqzone.marklogic.com] On Behalf Of Nizamuddin,
Rashid
Sent: Wednesday, July 13, 2005 1:57 PM
To: General XQZone Discussion
Subject: RE: [XQZone General] convert date into marklogic date

I got a new problem now
I have the dates entered into my xml document as 
  <date-time>2005-07-12T18:14:21.236-07:00</date-time> 
  <date-time>2005-07-12T18:14:30.971-07:00</date-time>

These are in string format. I need to get the max of the date among the
two.
I don't think so the max function works here since both of them are
stored a strings. Is there a way I can convert this into date and then
run the max function?
Any help...

Rashid

_______________________________________________
General mailing list
General at xqzone.marklogic.com
http://xqzone.com/mailman/listinfo/general



More information about the General mailing list