epoch to datetime python

datetime_time = datetime.datetime.fromtimestamp(epoch_time)

Here is what the above code is Doing:
1. We’re creating a datetime object from the epoch time.
2. We’re creating a datetime object from the current time.
3. We’re subtracting the two datetime objects to get a timedelta object.
4. We’re printing the timedelta object.