time.gmtime 返回一个 ParseTuple 对象,您可以使用元组的各个元素进行计算。像这样的东西
>>> time_epoch = time.gmtime(0)
>>> time_at_hand = time.gmtime(6928727.56235)
>>> print "It's been %d days somewhat like %d months, %d days and %d hours, %d minutes, %d seconds " % (time_at_hand.tm_yday - time_epoch.tm_yday, time_at_hand.tm_mon - time_epoch.tm_mon , time_at_hand.tm_mday - time_epoch.tm_mday, time_at_hand.tm_hour - time_epoch.tm_hour, time_at_hand.tm_min - time_epoch.tm_min, time_at_hand.tm_sec - time_epoch.tm_sec)
It's been 80 days somewhat like 2 months, 21 days and 4 hours, 38 minutes, 47 seconds