Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python windows get file modified date

# note: test.txt can also be a file path
import os.path, time
print("Last modified: %s" % time.ctime(os.path.getmtime("test.txt")))
print("Created: %s" % time.ctime(os.path.getctime("test.txt")))
Comment

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

PREVIOUS NEXT
Code Example
Python :: Import "reportlab" could not be resolved django 
Python :: is pythin a real coding language 
Python :: how to use headless browser in selenium python 
Python :: how to make a letter animation in python 
Python :: conda install lxml 
Python :: extract year from datetime pandas 
Python :: how to return PIL image from opencv 
Python :: cv2.cvtcolor grayscale 
Python :: cv2 add text 
Python :: column dataframe to int 
Python :: pandas change column to a string 
Python :: install docx python 
Python :: httpie on windows 
Python :: get statistics from array python 
Python :: selenium press tab python 
Python :: select first word in string python 
Python :: url decode python 
Python :: use incognito in selenium webdriver 
Python :: drop unnamed column pandas 
Python :: python get output of command to variable 
Python :: increase xlabel font size matplotlib 
Python :: convert python list to text file 
Python :: object to int64 pandas 
Python :: how to install mediapipe python 
Python :: how to program 
Python :: ImportError: matplotlib is required for plotting when the default backend "matplotlib" is selected. 
Python :: python how to generate random number in a range 
Python :: invert dictionary python 
Python :: installing django 
Python :: blank lines with csv.writer 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =