Generation

generate functionWed, 08 Feb 2023

how to convert numeric input to datetime in python

from datetime import datetime def str_to_time(val): val = int(val) return datetime.strptime(str(val), '%Y%m%d') str_to_time('20190101')

Questions about programming?Chat with your personal AI assistant