[Solved] int to datetime in Python [duplicate]

[ad_1]

from datetime import datetime

date_data="02012019 09:02:53" 
data = datetime.strptime(date_data,'%d%m%Y %H:%M:%S')
result = data.strftime('%d-%m-%Y %H:%M:%S')

# output '02-01-2019 09:02:53'

[ad_2]

solved int to datetime in Python [duplicate]