I use the following code to get modification date of file if it exists:
if os.path.isfile(file_name):
last_modified_date = datetime.fromtimestamp(os.path.getmtime(file_name))
else:
last_modified_date = datetime.fromtimestamp(0)
Is there a more elegant/short way?