I would like to know how can I get the complete date (day / month / year and hour / minute / second) of the last update of an excel file?
I would like to know how can I get the complete date (day / month / year and hour / minute / second) of the last update of an excel file?
As discussed in How to check the latest file in a folder with Python? you can use the property st_mtime
of file:
from pathlib import Path
diretorio = Path('.')
arquivo = diretorio/'data.txt'
print(arquivo.stat().st_mtime)
This will give you the timestamp of the last modification, so just convert it to date with the datetime