GH avatar Bite 128. Work with datetime's strptime and strftime

In this Bite you get some more practice with datetime's useful strptime and stftime.

Complete the two functions: years_ago and convert_eu_to_us_date following the instructions in their docstrings.

This is the defintion and difference between the two:

  • strptime: parse (convert) string to datetime object.
  • strftime: create formatted string for given time/date/datetime object according to specified format.

Reference: 8.1.8. strftime() and strptime() Behavior. Good luck and keep calm and code in Python!

Login and get coding
go back Beginner level
Bitecoin 2X

360 out of 374 users completed this Bite.
Will you be Pythonista #361 to crack this Bite?
Resolution time: ~39 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 3.5 on a 1-10 difficulty scale.
» You can do it! 😌

We use Python 3.7