from pathlib import Path import datetime p = Path(r'c:\test\test.txt') # ä½ææ¥ create_time = datetime.datetime.fromtimestamp(p.stat().st_ctime) # æ´æ°æ¥ update_time = datetime.datetime.fromtimestamp(p.stat().st_mtime) # ã¢ã¯ã»ã¹æ¥ access_time = datetime.datetime.fromtimestamp(p.stat().st_atime) print('ä½ææ¥', create_time) print('æ´æ°æ¥', update_time) print('ã¢ã¯ã»ã¹æ¥', access_time) pathlibã使ç¨ããã Path.stat()ã§ãã¹ã«é¢ããæ å ±
{{#tags}}- {{label}}
{{/tags}}