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.

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

Reply via email to