changeset 7716:6e7db5f06497 HEAD

More fixes to SEARCH BEFORE/ON/SINCE timezone handling.
author Timo Sirainen <tss@iki.fi>
date Thu, 21 Feb 2008 18:17:56 +0200
parents ab9c6952cc49
children 24470b86ee63
files src/lib-storage/index/index-search.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-search.c	Thu Feb 21 15:57:45 2008 +0200
+++ b/src/lib-storage/index/index-search.c	Thu Feb 21 18:17:56 2008 +0200
@@ -4,6 +4,7 @@
 #include "ioloop.h"
 #include "array.h"
 #include "istream.h"
+#include "utc-offset.h"
 #include "str.h"
 #include "message-address.h"
 #include "message-date.h"
@@ -183,6 +184,7 @@
 static int search_arg_match_cached(struct index_search_context *ctx,
 				   struct mail_search_arg *arg)
 {
+	struct tm *tm;
 	uoff_t virtual_size;
 	time_t date;
 	int timezone_offset;
@@ -194,7 +196,9 @@
 	case SEARCH_SINCE:
 		if (mail_get_received_date(ctx->mail, &date) < 0)
 			return -1;
-		date -= ioloop_timezone.tz_minuteswest*60;
+
+		tm = localtime(&date);
+		date += utc_offset(tm, date)*60;
 
 		switch (arg->type) {
 		case SEARCH_BEFORE: