+ 1
Hello :) how can the complete date of birth of the user be compared with the current date in the code?
So then i can write: "you are".. and not "you'll be.. years old" https://code.sololearn.com/c86ay45Dx1lP/?ref=app
3 Answers
+ 6
Amandine Kos ,
> to handle date and time correctly, we need to convert the input to a *datetime-object*.
to accomplish this, we need to import and use the *datetime* module.
> to find the difference of 2 *datetime objects*, we need an other module named *dateutil*
we have to import this module.
for more details have a look in the attached file.
(for more details have a look at the description of the *datetime* module):
https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
https://code.sololearn.com/csrWYW25NzPT/?ref=app
+ 3
Look up the datetime module (part of the standard library, so ok to import in the sololearn playground), notably datetime.date
+ 1
Thank u! :))