Compare 2 times

Peter Otten __peter__ at web.de
Wed Jun 6 09:35:20 EDT 2012


loial wrote:

> I have a requirement to test the creation time of a file with the
> current time and raise a message if the file is  more than 15 minutes
> old.
> 
> Platform is Unix.
> 
> I have looked at using os.path.getctime for the file creation time and

ctime is not actually the creation time:
http://www.brandonhutchinson.com/ctime_atime_mtime.html

> time.time() for the current time, but is this the best approach?

What kind of improvement do you have in mind?




More information about the Python-list mailing list