fixed timezone bug
This commit is contained in:
parent
0afdb1a2f0
commit
7f36ab371d
|
|
@ -1118,18 +1118,18 @@ def build_imap_filter():
|
||||||
if options.date_old_max == None:
|
if options.date_old_max == None:
|
||||||
time_now = time.time()
|
time_now = time.time()
|
||||||
secs_old_max = (options.days_old_max * 24 * 60 * 60)
|
secs_old_max = (options.days_old_max * 24 * 60 * 60)
|
||||||
time_old = time.gmtime(time_now - secs_old_max)
|
time_old = time.localtime(time_now - secs_old_max)
|
||||||
else:
|
else:
|
||||||
time_old = time.gmtime(options.date_old_max)
|
time_old = time.localtime(options.date_old_max)
|
||||||
time_str = time.strftime('%d-%b-%Y', time_old)
|
time_str = time.strftime('%d-%b-%Y', time_old)
|
||||||
imap_filter.append("BEFORE %s" % time_str)
|
imap_filter.append("BEFORE %s" % time_str)
|
||||||
|
|
||||||
if options.date_old_min == None:
|
if options.date_old_min == None:
|
||||||
time_now = time.time()
|
time_now = time.time()
|
||||||
secs_old_min = (options.days_old_min * 24 * 60 * 60)
|
secs_old_min = (options.days_old_min * 24 * 60 * 60)
|
||||||
time_old = time.gmtime(time_now - secs_old_min)
|
time_old = time.localtime(time_now - secs_old_min)
|
||||||
else:
|
else:
|
||||||
time_old = time.gmtime(options.date_old_min)
|
time_old = time.localtime(options.date_old_min)
|
||||||
time_str = time.strftime('%d-%b-%Y', time_old)
|
time_str = time.strftime('%d-%b-%Y', time_old)
|
||||||
imap_filter.append("SINCE %s" % time_str)
|
imap_filter.append("SINCE %s" % time_str)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue