2002-01-05 11:31:49 +00:00
|
|
|
import imaplib
|
|
|
|
import time
|
|
|
|
|
2002-07-27 00:38:30 +00:00
|
|
|
# Can't use time.time() values, as they are O/S specific
|
2002-06-17 07:06:24 +00:00
|
|
|
|
2002-07-27 00:38:30 +00:00
|
|
|
timevalues = [(2033, 5, 18, 3, 33, 20, 2, 138, 0), '"18-May-2033 13:33:20 +1000"']
|
2002-01-05 11:31:49 +00:00
|
|
|
|
|
|
|
for t in timevalues:
|
2002-07-27 00:38:30 +00:00
|
|
|
t1 = imaplib.Time2Internaldate(t)
|
|
|
|
t2 = imaplib.Time2Internaldate(imaplib.Internaldate2tuple('INTERNALDATE ' + imaplib.Time2Internaldate(t)))
|
|
|
|
if t1 <> t2:
|
2002-06-17 07:06:24 +00:00
|
|
|
print 'incorrect result when converting', `t`
|