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")))
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")))
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 )
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us