Python:如何获取文件夹的创建日期和时间?

Ric*_*cky 6 python directory

可能重复:
如何在Python中创建文件和修改日期/时间?

我想获取文件夹的创建日期和时间.反正有没有在python中这样做?

谢谢

How*_*ard 14

您可以使用它os.stat来检索此信息.

os.stat(path).st_mtime      // time of most recent content modification,
os.stat(path).st_ctime      // platform dependent; time of most recent metadata change on Unix, or the time of creation on Windows)
Run Code Online (Sandbox Code Playgroud)