[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

sb-rss.el and ISO 8601 date


while hacking on a shimbun backend I stumbled over a site[1] whose rss
date format didn't get parsed properly by sb-rss.el:


sb-rss.el says:
  ;; make Date string from ISO 8601 date format.  See
  ;; http://www.w3.org/TR/NOTE-datetime.

Above date is a correct[2] ISO 8601 date, but W3C seems to command an
additional colon in the timezone.

The patch below makes sb-rss.el also accept the ISO 8601 version
without colon, without introducing ambiguity.


[1] http://www.welt.de/z/newsticker/ticker_welt.xml
[2] according to this interpretation of the standard:

RCS file: /storage/cvsroot/emacs-w3m/shimbun/sb-rss.el,v
retrieving revision 1.17
diff -u -r1.17 sb-rss.el
--- sb-rss.el   5 May 2004 23:00:43 -0000       1.17
+++ sb-rss.el   13 Jun 2004 00:24:31 -0000
@@ -76,7 +76,7 @@
   ;;      hh   = two digits of hour (00 through 23) (am/pm NOT allowed)
   (let (year month day minutes timezone)
     (if (or (null date) (not (string-match
-             "\\([0-9][0-9][0-9][0-9]\\)\\(-[0-9][0-9]\\)?\\(-[0-9][0-9]\\)?T?\\([0-9][0-9]:[0-9][0-9]\\(:[.0-9]+\\)?\\)?\\(\\+[0-9][0-9]:[0-9][0-9]\\|Z\\)?"
+             "\\([0-9][0-9][0-9][0-9]\\)\\(-[0-9][0-9]\\)?\\(-[0-9][0-9]\\)?T?\\([0-9][0-9]:[0-9][0-9]\\(:[.0-9]+\\)?\\)?\\(\\+[0-9][0-9]:?[0-9][0-9]\\|Z\\)?"
       (setq year (match-string-no-properties 1 date)