Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] Incorrect time zone conversion in the output of search

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Thu Dec 06 2007 - 01:57:02 GMT
On Wed, Dec 05, 2007 at 02:32:04PM -0800, Terry Hung wrote:
> Hi,
> 
>    We observed that up to 9 hours of information did not show up when we used
> time limits as criteria. The time zone conversion of disk files seems to be 
> incorrect. 
> 
> Example 1:
> 
>     1. Search in a CET time zone		#__ Title of message
>     Date1:  2006-02-07 18:29:08 GMT 		#__ the original file timestamp
>     Date:   2006-02-08 03:29:08 CET		#__ the timestamp by swish-e
>     <snip>...
> 
>     Swish-e conversion: 2006-02-07 18:29:08 GMT -> 2006-02-08 03:29:08 CET
>     Correct conversion: 2006-02-07 18:29:08 GMT -> 2006-02-07 19:29:08 CET
> 
>   The "Date1" is the original timestamp of the file while the "Date:" is the 
> timestamp derived by swish-e. The conversion seems to be 8 hours off since
> CET=GMT+1hr.


There's no timezone info stored in the index, just a unix
timestamp.  So, I'd expect server configuration would be the
difference.


The dates that swish does display are done with:

    if ( is_meta_date(meta_entry) )
    {
        s=emalloc(30);
        i = convPropValue2ULong(prop->propValue); /* read binary */
        i = UNPACKLONG(i);     /* Convert the portable number */
        strftime(s,30, DATE_FORMAT_STRING, (struct tm *)localtime((time_t *)&i));
        return s;
    }

This looks right, no?

moseley@bumby:~$ date                   
Wed Dec  5 17:51:14 PST 2007
moseley@bumby:~$ date -u
Thu Dec  6 01:51:16 UTC 2007

moseley@bumby:~$ echo hello > foo.txt
moseley@bumby:~$ swish-e -i foo.txt -v0

moseley@bumby:~$ swish-e -w not dkdk -p swishlastmodified -H0
1000 foo.txt "foo.txt" 6 "2007-12-05 17:51:32 PST"

moseley@bumby:~$ TZ=CET swish-e -w not dkdk -p swishlastmodified -H0 
1000 foo.txt "foo.txt" 6 "2007-12-06 02:51:32 CET"



-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs

_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Wed Dec 5 20:57:01 2007