cURL / Mailing Lists / curl-users / Single Mail

curl-users

If-Modified-Since fields not always in GMT

From: Phil Karn <karn_at_qualcomm.com>
Date: Fri, 13 Apr 2001 17:28:21 -0700 (PDT)

I'm writing some scripts that use Curl 6.0. I just discovered that
when you use the --time-cond option, curl will generate an HTTP
"If-Modified-Since" header in the local timezone (in my case, PDT).

RFC2616 (ftp://ftp.isi.edu/in-notes/rfc2616.txt) specifies "All
HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT),
without exception. For the purposes of HTTP, GMT is exactly equal to
UTC (Coordinated Universal Time)." (see page 20 of RFC2616).

A quick workaround is to set the environment variable TZ to "GMT0" in
the shell script that calls curl, but this really ought to be fixed
inside curl itself.

A related comment: Curl should set the modification timestamp of the
local output file to the header timestamp in the incoming HTTP reply
from the server, and there should be an easier way than "--time-cond
filename" to specify a conditional get that fetches the remote file
only if it is newer than the local copy. In fact, this conditional get
should arguably be the default behavior for all fetches.

Thanks!

Phil Karn
Received on 2001-04-14