Python date and time snippets

Documentation

Import directives


In [ ]:
import datetime

Get current date and time


In [ ]:
datetime.datetime.now()

In [ ]:
print(datetime.datetime.now())