Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python get date file last modified

import os, time
# Get file's Last modification time stamp only in terms of seconds since epoch 
modTimesinceEpoc = os.path.getmtime(filePath)
# Convert seconds since epoch to readable timestamp
modificationTime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(modTimesinceEpoc))
print("Last Modified Time : ", modificationTime )
Source by thispointer.com #
 
PREVIOUS NEXT
Tagged: #python #date #file #modified
ADD COMMENT
Topic
Name
9+3 =