Is there any handy functions can retrieve timestamp from given files or even compare them? My ideal usage would be like this:
time_diff = date(file_path_a) - date(file_path_b) # time_diff would be a formatted string such as 2days 3hrs 16 mins
I know there is a built-in datetime module in python, but I haven’t found anything similar to my usage. And I know I can achieve similar effect by issuing os.stat(file_path) to get the timestamp, and transform them to the format I want. Just wondering if there are any more handy function to do this.
… and then format the resulting
datetime.timedeltaobject in the desired way.