(nnrss-normalize-date): Accept Unix-style epoch timestamps.
authorTeodor Zlatanov <tzz@lifelogs.com>
Wed, 14 May 2008 19:51:51 +0000 (19:51 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Wed, 14 May 2008 19:51:51 +0000 (19:51 +0000)
lisp/ChangeLog
lisp/nnrss.el

index 402711f..ba2b64d 100644 (file)
@@ -1,5 +1,7 @@
 2008-05-14  Teodor Zlatanov  <tzz@lifelogs.com>
 
+       * nnrss.el (nnrss-normalize-date): Accept Unix-style epoch timestamps.
+
        * auth-source.el: Preliminary Tramp docs.
        (auth-sources): Change the default auth-sources to use
        EPA .gpg files.
index cd12b82..4bebb11 100644 (file)
@@ -500,8 +500,11 @@ nnrss: %s: Not valid XML %s and w3-parse doesn't work %s"
 This function handles the ISO 8601 date format described in
 <URL:http://www.w3.org/TR/NOTE-datetime>, and also the RFC822 style
 which RSS 2.0 allows."
-  (let (case-fold-search vector year month day time zone cts)
-    (cond ((null date))
+  (let (case-fold-search vector year month day time zone cts given)
+    (cond ((null date))                        ; do nothing for this case
+         ;; if the date is just digits (unix time stamp):
+         ((string-match "^[0-9]+$" date)
+          (setq given (seconds-to-time (string-to-number date))))
          ;; RFC822
          ((string-match " [0-9]+ " date)
           (setq vector (timezone-parse-date date)
@@ -559,7 +562,7 @@ which RSS 2.0 allows."
                  (if zone
                      (concat " " zone)
                    "")))
-      (message-make-date))))
+      (message-make-date given))))
 
 ;;; data functions