Get the date of last modification of a file

Gerhard Häring gh at ghaering.de
Mon Sep 8 13:19:32 EDT 2003


Manuel Bastioni wrote:
> It's possible using only a built-in module?

Sure:

 >>> import os, stat
 >>> s = os.stat("c:/tmp")
 >>> time.strftime("%Y-%m-%d %H:%M", time.localtime(s.st_mtime))
'2003-09-08 19:17'

> Outgoing mail is certified Virus Free.

What a stupid thing to say.

-- Gerhard





More information about the Python-list mailing list