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

2024-06-26 13:24:32 发布

您现在位置:Python中文网/ 问答频道 /正文

Possible Duplicate:
How to get file creation & modification date/times in Python?

我想得到一个文件夹的创建日期和时间。在python中有什么方法可以做到这一点吗?

谢谢你


Tags: to方法in文件夹getdate时间how
1条回答
网友
1楼 · 发布于 2024-06-26 13:24:32

您可以使用^{}检索此信息。

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)

相关问题 更多 >