Windows文件创建日期/时间使用python [英] Windows file creation date/time using python

查看:114
本文介绍了Windows文件创建日期/时间使用python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用python获取文件创建日期和时间。我试过:

I need to get a file creation date&time using python. I tried:

os.stat(r"path")[ST_CTIME]

但它正在返回:

1263538277

这不是创建日期时间。有没有办法呢?

This is not the creation date time. Is there a way to do it?

推荐答案

为什么不?

>>> import time
>>> time.ctime(1263538277)
'Fri Jan 15 04:51:17 2010'

看起来像是有效的创作时间。

Looks like a valid creation time to me.

这篇关于Windows文件创建日期/时间使用python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆