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

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 :: python time now other timezone 
Python :: python replace backslash with forward slash 
Python :: HOw to use passlock password manager python 
Python :: get website content with beautifulsoup 
Python :: python check if there is internet 
Python :: put text on image python 
Python :: python format 2 digits 
Python :: How to fix snap "pycharm-community" has "install-snap" change in progress 
Python :: python pyodbc install 
Python :: fill missing values with 0 pandas 
Python :: how to clear a command line python 
Python :: pandas group by month 
Python :: delete unnamed 0 columns 
Python :: python duplicate file 
Python :: matoplotlib set white background 
Python :: python infinite value 
Python :: python create a list of alphabets 
Python :: cos in python in degrees 
Python :: pandas series values into strings 
Python :: save image requests python 
Python :: pandas determine percentage of nans in column 
Python :: godot white shader 
Python :: min int python 
Python :: django filter not equal to 
Python :: remove nan from list python 
Python :: convert numpy array to dataframe 
Python :: django docs case when 
Python :: display selective fields in admin page django 
Python :: install library from python code 
Python :: pandas datetime now 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =