Exercise

Converting format with datetimes

With datetimes, you can read a string with one format and output a string with a different format. This means that you can use datetimes to change the format of string dates. The format strings for mapping datetimes are can be found at strftime. Let's say you are asked to process the date of the British Black Wednesday crash into a new format that fits the reporting needs of your company.

Instructions

100 XP
  • Create a format string that fits the original string date, given as org_text.
  • Create a datetime for Black Wednesday and save it as black_wednesday.
  • Create a format string that fits the new format, 'Wednesday, September 16, 1992'.
  • Create a new string date using the new format.