获得创建时间(Get created time)
为了得到python文件的最后修改时间,我这样做:
lastmodifiedTime = os.path.getmtime(filename)我如何获得创建的时间?
To get the last modified time of a file in python, I do:
lastmodifiedTime = os.path.getmtime(filename)How do I get the created time?
最满意答案
如果你在Windows上,那么os.path.getctime()是文件创建时间。 在其他平台上,这些信息没有被存储,并且该函数返回最后的更改时间。
If you are on Windows, then os.path.getctime() is the file creation time. On other platforms that information is not stored and that function returns the last change time instead.
更多推荐
发布评论