How to Solve NameError: name 'mktime' is not defined -- time

Solution: Import the 'mktime' module

To Solve the error, add the following line to the top of your code.

from time import mktime

 

For more information:
Python time mktime