import datetime
import dateutil.relativedelta
dt1 = datetime.datetime.fromtimestamp(123456789)
dt2 = datetime.datetime.fromtimestamp(234567890)
rd = dateutil.relativedelta.relativedelta(dt2, dt1)
print('%d years, %d months, %d days, %d hours, %d minutes and %d seconds' % (rd
    .years, rd.months, rd.days, rd.hours, rd.minutes, rd.seconds))
How can I produce a human readable difference when subtracting two UNIX timestamps using Python?