IBM DB2 CAST AS VARCHAR versus Python Pandas to_datetime Function

Change your format string:

dt_string = '2020-06-09-13.15.00.000000'
pd.to_datetime(dt_string, format='%Y-%m-%d-%H.%M.%S.%f')

Correctly converts the string:

Timestamp('2020-06-09 13:15:00')

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top