python 24 hour time code example Example: last 24 hour python datetime lastHourDateTime = datetime.datetime.now() - datetime.timedelta(hours = 1)