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

Solution: Import the 'time' module

# Add the following line to the top of your code
from astropy import time

 

For more information:
astropy time