Get File Creation Date
Get File Creation and Modification Date
In this example, you will learn to get file creation and modification date.
To understand this example, you should have the knowledge of the following Python programming topics:
Example 1: Using os module
Output
getmtime()
gives the last modification time whereas getctime()
gives the last metadata change time in Linux/Unix and path creation time in Windows.
Example 2: Using stat() method
Output
Similar to example 1, st_mtime refers to the time of last modification; whereas,st_ctime refers to the time of the last metadata change on Linux/Unix and creation time on Windows.
Last updated
Was this helpful?