When using DateTimeAsPython
for my output map, I found that the microsecond value in datetime.datetime
was 1000 times the value stored in the database. here's a patch:
--- Sybase.py (revision xxx) +++ Sybase.py (working copy) @@ -197,10 +197,10 @@ DateTimeAsPython = { CS_DATETIME_TYPE: lambda val: datetime.datetime(val.year, val.month + 1, val.day, val.hour, val.minute, - val.second, val.msecond * 1000), + val.second, val.msecond), CS_DATETIME4_TYPE: lambda val: datetime.datetime(val.year, val.month + 1, val.day, val.hour, val.minute, - val.second, val.msecond * 1000) } + val.second, val.msecond) } if _have_cs_date_type: DateTimeAsPython.update({ CS_DATE_TYPE: lambda val: datetime.date(val.year, val.month + 1, val.day) })
Additional note: DateTimeAsPython
also raises an error if the datetime field is NULL, probably not the desired behavior.