My concern is that fn:fomat-dateTime formatting is different between versions 
of MarkLogic.

fn:format-dateTime(fn:current-dateTime(), "[FNn,*-3], [D1,2] [MNn,*-3] [Y] 
[H01]:[m01]:[s01] [Z]")

That code returns different values for ML5 and ML6. Which one is correct?

From: [email protected] 
[mailto:[email protected]] On Behalf Of David Lee
Sent: Friday, May 03, 2013 8:52 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] dateTime formatting difference between ML5 
and ML6

This is correct behaviour.
XSD DateTime as described in xmlschema
http://www.w3.org/TR/xmlschema-2/#dateTime

is a variant of ISO 8601 not RFC822

" For example, 2002-10-10T12:00:00-05:00 (noon on 10 October 2002, Central 
Daylight Savings Time as well as Eastern Standard Time in the U.S.) is 
2002-10-10T17:00:00Z, five hours later than 2002-10-10T12:00:00Z."



-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]<mailto:[email protected]>
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com<http://www.marklogic.com/>

From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Daniel S. Smith 
(ICS)
Sent: Friday, May 03, 2013 10:39 AM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] dateTime formatting difference between ML5 and 
ML6

I'm working on creating an RSS feed and need to provide an RFC822 formatted 
dateTime in order for the feed to validate.

It looks like the implementation for fn:format-dateTime() has changed between 
versions of MarkLogic.

The documentation for a valid RSS date is here: 
http://validator.w3.org/feed/docs/error/InvalidRFC2822Date.html

This is an example of a valid value: <pubDate>Wed, 02 Oct 2002 15:00:00 
+0200</pubDate>

Here is the code that should work:

fn:format-dateTime(fn:current-dateTime(), "[FNn,*-3], [D1,2] [MNn,*-3] [Y] 
[H01]:[m01]:[s01] [Z]")

-In ML 5.0-5 I get the following (a valid result):

  Fri, 03 May 2013 08:29:49 -0600

-In ML 6.0-2.3 I get this (an invalid result because of the colon in the time 
zone offset):

  Fri, 03 May 2013 08:31:49 -06:00

If I try to use the name of the time zone I get a different problem:

fn:format-dateTime(fn:current-dateTime(), "[FNn,*-3], [D1,2] [MNn,*-3] [Y] 
[H01]:[m01]:[s01] [ZN,*-3]")

-ML5 result (not good):

  Fri, 03 May 2013 08:35:16 GMT-06:00

-ML6 result (good):

  Fri, 03 May 2013 08:35:35 GMT

Is this a bug or something I need to work around?

-Dan


NOTICE: This email message is for the sole use of the intended recipient(s) and 
may contain confidential and privileged information. Any unauthorized review, 
use, disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply email and destroy all copies of 
the original message.


 NOTICE: This email message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email and destroy all 
copies of the original message.

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to