Source Code:
(back to article)
import datetime # Define a date and time string date_string = "2022-01-01 12:00:00" # Parse the date and time string parsed_datetime = datetime.datetime.strptime(date_string, "%Y-%m-%d %H:%M:%S") print(parsed_datetime)
Result:
Report an issue