Re: [htdig] [Q]: MORE SPECIFICS: How to set it up to search by date?

Gilles Detillieux (
Wed, 24 Feb 1999 10:06:08 -0600 (CST)

According to mike grommet:
> very very interesting... how would I go about having my cgi return a last
> updated header?
> Any examples you know of?

No practical examples, no, but I did perform a small test just to satisfy
myself that it works. I created a simple index.cgi script in a directory
on my web server, that begins with:


echo "Content-type: text/html
Last-Modified: Tue, 23 Dec 1997 18:12:54

and sure enough, when I ran htdig -vvv against that directory, it
seemed to pick up the last modified date that the script spit out.
Of course, in practise you wouldn't hard code the date the way I did,
but if you follow that same format, your web server should pick up
the header and pass it on to htdig, which will parse it and use it as
the document modification time.

If you use the sort by Time option in htsearch, your documents will
be ranked from most recent to least, according to the dates and times
your CGI script outputs. And, if you modify htsearch to allow user
specification of allowed date ranges in a search, this should do the trick
for you. Just remember that the modification times are stored internally
in the database as time_t fields, so the user specified dates defining
the range will also need to be converted to time_t values for comparisons.
See the getdate() function in htdig/ to see how that's done.

Good luck.

Gilles R. Detillieux              E-mail: <>
Spinal Cord Research Centre       WWW:
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930
To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the SUBJECT of the message.

This archive was generated by hypermail 2.0b3 on Fri Feb 26 1999 - 14:34:12 PST