I have a file on a remote server, and I'm using pysftp to connect to the server. I'm trying to get how old the file is on the server and I can't seem to find a function to get the AGE in DAYS for the file using pysftp or Paramiko. (If I'm wrong, do tell please).
I'm using the mtime function to get the modified time for the file (assuming that was when it was last uploaded). How do I convert this mtime to DAYS? Dividing by 86,400 doesn't work as I'm guessing this is since Epoch time?
Your help is greatly appreciated!
Thanks.
To convert to days use datetime.timedelta:
using time