Search
 
SCRIPT & CODE EXAMPLE
 

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 )
Comment

python get last modification time of file

import os
time = os.path.getmtime("file.txt")

print(time) # 1600113737.82
Comment

PREVIOUS NEXT
Code Example
Python :: get highest value from dictionary python 
Python :: random select algo 
Python :: required validator python WTForms 
Python :: load from np file py 
Python :: python hour from date 
Python :: seaborn increace figure size 
Python :: xpath beautifulsoup 
Python :: load saved model pyspark 
Python :: trigonometry in python 
Python :: custom 404 page flask 
Python :: convert integer to datetime in python 
Python :: python input comma separated values 
Python :: PySpark null or missing values 
Python :: check odd numbers numpy 
Python :: load ui file pyqt5 
Python :: pandas set font size plot 
Python :: loop through groupby pandas 
Python :: check if any values overlap in numpy array 
Python :: python - exclude rowin data frame based on value 
Python :: adjust tick label size matplotlib 
Python :: stop a subprocess python 
Python :: extract numbers from sklearn classification_report 
Python :: program to calculate the volume of sphere python 
Python :: Unable to locate package python3.6-venv 
Python :: get text from url python last slash 
Python :: pil to rgb 
Python :: django related_name abstract class 
Python :: binary to text python 
Python :: runner up score hackerrank 
Python :: get current file location 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =