# HG changeset patch # User Teodor Zlatanov # Date 1204220500 0 # Node ID 76175fc0a2f935bc1650ca89afaf7c32932ccdd6 # Parent 0a7ef96a09e4d35f91fd195c3afde94b4bdee675 (url-get-normalized-date): Simplify to use `format-time-string'. Always generate date in UTC, but call it GMT for full compatibility with the RFCs. diff -r 0a7ef96a09e4 -r 76175fc0a2f9 lisp/url/ChangeLog --- a/lisp/url/ChangeLog Thu Feb 28 17:09:18 2008 +0000 +++ b/lisp/url/ChangeLog Thu Feb 28 17:41:40 2008 +0000 @@ -1,3 +1,9 @@ +2008-02-28 Teodor Zlatanov + + * url-util.el (url-get-normalized-date): Simplify + to use `format-time-string'. Always generate date in UTC, but + call it GMT for full compatibility with the RFCs. + 2008-02-06 Michael Albinus * url-handlers.el (file-remote-p): Add handler. diff -r 0a7ef96a09e4 -r 76175fc0a2f9 lisp/url/url-util.el --- a/lisp/url/url-util.el Thu Feb 28 17:09:18 2008 +0000 +++ b/lisp/url/url-util.el Thu Feb 28 17:41:40 2008 +0000 @@ -185,33 +185,10 @@ ;;;###autoload (defun url-get-normalized-date (&optional specified-time) - "Return a 'real' date string that most HTTP servers can understand." - (require 'timezone) - (let* ((raw (if specified-time (current-time-string specified-time) - (current-time-string))) - (gmt (timezone-make-date-arpa-standard raw - (current-time-zone) - "GMT")) - (parsed (timezone-parse-date gmt)) - (day (cdr-safe (assoc (substring raw 0 3) url-weekday-alist))) - (year nil) - (month (car - (rassoc - (string-to-number (aref parsed 1)) url-monthabbrev-alist))) - ) - (setq day (or (car-safe (rassoc day url-weekday-alist)) - (substring raw 0 3)) - year (aref parsed 0)) - ;; This is needed for plexus servers, or the server will hang trying to - ;; parse the if-modified-since header. Hopefully, I can take this out - ;; soon. - (if (and year (> (length year) 2)) - (setq year (substring year -2 nil))) - - (concat day ", " (aref parsed 2) "-" month "-" year " " - (aref parsed 3) " " (or (aref parsed 4) - (concat "[" (nth 1 (current-time-zone)) - "]"))))) + "Return a 'real' date string that most HTTP servers can understand." + (let ((system-time-locale "C")) + (format-time-string "%a, %d %b %Y %T GMT" + (or specified-time (current-time)) t))) ;;;###autoload (defun url-eat-trailing-space (x)