-
Hi team, I Am trying to fetch data and write it to a CSV file which is completely fine. So, I would like to get it as a date only. Is it possible to handle with connection.outputtypehandler as date instead of datetime.datetime like NUMBER to DECIMAL in the example? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This was resolved using Outupthandler & Outconverter def output_type_handler(cursor, name, default_type, size, precision, scale): |
Beta Was this translation helpful? Give feedback.
This was resolved using Outupthandler & Outconverter
def datetime_to_date(value):
return datetime.date.strftime(value,"%Y-%m-%d")
def output_type_handler(cursor, name, default_type, size, precision, scale):
if default_type == odb.DB_TYPE_DATE:
return cursor.var(datetime.date, arraysize=cursor.arraysize,outconverter=datetime_to_date)