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
When getting datetime data from SQL Server, the subsecond value has 7 digits. The code assumes there to be 6 or fewer digits.
To get this working, I truncated the subsecond value to the first 6 digits, so that it has millisecond values.
I changed the last line of dttm_cvt to be: else: return datetime.datetime(int(x[0:4]),int(x[5:7]),int(x[8:10]),int(x[10:13]),int(x[14:16]),int(x[17:19]),int(x[20:].ljust(6,'0')[0:6]))
Similarly, I changed the last line of tm_cvt to be: else: return datetime.time(int(x[0:2]),int(x[3:5]),int(x[6:8]),int(x[9:].ljust(6,'0')[0:6]))
The text was updated successfully, but these errors were encountered:
When getting datetime data from SQL Server, the subsecond value has 7 digits. The code assumes there to be 6 or fewer digits.
To get this working, I truncated the subsecond value to the first 6 digits, so that it has millisecond values.
I changed the last line of dttm_cvt to be:
else: return datetime.datetime(int(x[0:4]),int(x[5:7]),int(x[8:10]),int(x[10:13]),int(x[14:16]),int(x[17:19]),int(x[20:].ljust(6,'0')[0:6]))
Similarly, I changed the last line of tm_cvt to be:
else: return datetime.time(int(x[0:2]),int(x[3:5]),int(x[6:8]),int(x[9:].ljust(6,'0')[0:6]))
The text was updated successfully, but these errors were encountered: