You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
iliyan85
changed the title
Time2Internaldate is not working with int of float time
Time2Internaldate is not working with int or float time
Jul 28, 2024
time.time() or other int or float value throws an exception when it is using as date_time input for Time2Internaldate function.
The error message is:
UnboundLocalError: cannot access local variable 'dt' where it is not associated with a value
if isinstance(date_time, (int, float)): #time.time() returns True
tt = time.localtime(date_time)
and after that
fmt = '"%d-{}-%Y %H:%M:%S %z"'.format(MonthNames[dt.month])
'dt' cannot be used.
Time2Internaldate works correctly by the following way:
dt = datetime.datetime.now(pytz.timezone('Europe/Sofia'))
imaplib2.Time2Internaldate(dt)
The text was updated successfully, but these errors were encountered: