Just a quick one whilst we're picking up some tips and tricks whilst using Python packages.
The datetime module comes in handy when formatting dates, returning the date time at runtime, figure out time zones, and much more.
Typically it does not require an install as it's part of the build in standard python library but we do have to import it when running in an environment.
import datetime
It'll do the job but when trying to get the date time we would have to write
datetime.datetime.now()
This always threw me off, as both the module and class are the same name (e.g. module.class.method : datetime.datetime.now() )
Quickly changing your import to
from datetime import datetime
we can now call on it by writing
datetime.now()
the standard aliasing will work too so changing it to
from datetime import datetime as dt
allows you to call the date time as
dt.now()
Albeit, not my preference.
