According to Geoff Hutchison: > On Tue, 30 Mar 1999, mike grommet wrote: > > No one is indexing on the fly anyway right? So I assume we could just zero > > out the > > hrs, mins, second fields of the date+time? > > At the moment I cannot see why someone would want to search for an exact > time. However, assumptions about not indexing on the fly should not be > made since that's one of the goals for 3.2. > > To answer your question, for now you can just zero out the hr, min, sec. > fields (which will set it to midnight). Life gets a bit more complicated > since we still have to figure out what timezone... For simplicity, I > suggest the *server's* timezone (which may not be the same as the > user's). Using the server's timezone would be consistent with how the modification times are displayed in the long format search results. It uses localtime() for that, so I guess you'd use timelocal() to do the reverse conversion, instead of timegm(). > > I would expect the entering of dates > > using month, day, year select boxes (1 each). Then, htsearch can piece them > > together into one long string > > for the comparison? > > Well there seems to be consensus for separate fields for from-month, > to-month, etc. This would solve the formatting problems--they're > unambiguous. And people could write wrappers to convert their format to > the expected multiple-field format. Sounds fine with me. > (BTW, it should probably be written that if a field is missing, it's reset > to the minimum. So from-year=1999 goes from 1/1/99... Also, if the > to fields are missing, they should probably be set to the current time by > default.) You may want to handle the from and to fields differently, depending on whether you want the "to" to be inclusive or exclusive. I.e., if a search from 1998-09-01 to 1998-10-01 should be up to, but not including, Oct. 1, then you can zero out the time fields in the tm structure for the end time, and check that ref->DocTime() < endtime, where endtime is set to the time_t derived from the timelocal() conversion of the tm structure. However, if it should be up to and including Oct. 1, then you should set tm_hour, tm_min & tm_sec to 23, 59 & 59, and check that ref->DocTime() <= endtime. Similar consideration will be needed to determine appropriate default values if some, but not all date fields are specified. E.g. if only the year is specified, you likely want the whole year. If the year is omitted, assume the current year. That sort of thing. -- Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]> Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil Dept. Physiology, U. of Manitoba Phone: (204)789-3766 Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930 ------------------------------------ To unsubscribe from the htdig3-dev mailing list, send a message to [EMAIL PROTECTED] containing the single word "unsubscribe" in the SUBJECT of the message.
