On Fri, 2007-05-11 at 08:54 -0600, Trever Adams wrote:

> > So you'll need to use "11-May-2007". It doesn't support time.
> >   
> Tim, thank you. I am afraid I do not understand if the date is only 
> allowed as such why does python's imaplib convert the date as such?!? 

Interesting. I just noticed another bug too, it pads with spaces:
" 1-May-07 ..."

Try this in my script:

# this line is already there
sentbefore = imaplib.Time2Internaldate(time.time() - float(sys.argv[1]) * 24 * 
60 * 60)

# add these lines
sentbefore = sentbefore.split('"')[1].split()[0]
sentbefore = '"%s"' % sentbefore

Or maybe just replace it all with:

sentbefore = time.strftime("%d-%b-%Y", time.localtime(time.time() - 
float(sys.argv[1]) * 24 * 60 * 60))

johannes

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to