How to Solve NameError: name 'datetime' is not defined -- datetime

Erorr: name 'datetime' is not defined

NameError: name 'datetime' is not defined

Solution: name 'datetime' is not defined

# Add the following line to the top of your code.
from datetime import datetime

 

For more information:
Python datetime

If the error has not been solved: