|
From: | Jason Rumney |
Subject: | Re: make standard If-Modified-Since headers |
Date: | Wed, 27 Feb 2008 22:24:07 +0000 |
User-agent: | Thunderbird 2.0.0.12 (Windows/20080213) |
Ted Zlatanov wrote:
The specific function change I am proposing, so we have a specific reference point: (defun url-get-normalized-date (&optional specified-time) "Return a 'real' date string that most HTTP servers can understand." (let ((system-time-locale "C"))(format-time-string "%a, %d %b %Y %T %Z" (or specified-time (current-time)))))Will this work on all systems? It avoids the hardcoded week and month abbreviations through the locale specification, but I can only test that on Linux.
IIRC, only a small subset of timezone names are allowed in HTTP headers, so %z would be better than %Z, or alternatively hardcode GMT:
... (format-time-string "%a, %d %b %Y %T GMT" (or specified-time (current-time)) t) ...%Z seems to give an empty string here (Windows XP), but that is probably a bug.
[Prev in Thread] | Current Thread | [Next in Thread] |