Exercise

Datetimes from strings

Often you get dates in different formats. There are many different sources of data that represent dates as strings. Scraping web pages, user input, and text files are just a few. The format strings for mapping datetimes are can be found at strftime. Suppose that you have found dates for the mini-crash of October 1989, given as the string crash_text, and the recession of July 3rd 1990, given as the string recession_text, in different formats. How would you represent both in your Python code?

Instructions

100 XP
  • Construct a format string that maps to the given text for the mini-crash of 1989.
  • Construct a format string that maps to the text for the recession of 1990.
  • Create a datetime representing the recession of 1990.