python get local datetime code example Example: python local date time import pytz datetime.datetime.now(pytz.timezone('Europe/Rome'))