Python short course: datatime to convert different string time foramt in date format

We can use datetime to convert different string time foramts into date format.

string_time = '2008-12-31T20:30:00'
TIME_FORMAT = "%Y%-%m-%dT%H:%M:%S" # we can change this format according to the string format
datatime.striptime(string_time, TIME_FORMAT)

Comments

Popular posts from this blog

Lab's weekly topic - week 50 2023 - Detailed explanation for encoder of U-Net

Lab's recommendation: Awesome books to learn machine learning and AI (continue updating)