On this page
genericpath.getmtime
Prev: genericpath.getctime | Up: genericpath | Next: genericpath.getsize
Rel: genericpath.commonprefix, genericpath.exists, genericpath.getatime, genericpath.getctime
Ref: docs.python.org — genericpath.getmtime
Tags: #public #python3 #stdlib #genericpath
Import
import genericpath
from genericpath import getmtime
Signature & Overview
genericpath.getmtime(filename)
Return the last modification time of a file, reported by os.stat().
Usage
import os
assert os.path.getmtime(".") > 0
Gotchas
- Returns last modification time as epoch float seconds: Use
Path.stat().st_mtime_nsfor nanosecond precision.
REPL Inspect
from genericpath import getmtime
help(getmtime)
Linked from
Related notes
- tuts/python3/stdlib_module/genericpath/commonprefix Linked here; links to this page; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/exists Linked here; links to this page; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/getatime Linked here; links to this page; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/getctime Linked here; links to this page; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/getsize Linked here; links to this page; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/genericpath/isdevdrive shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/isdir shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/isfile shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/isjunction shared tags: #genericpath, #stdlib