Thanks a mill - os.path.getctime(f) is what I needed. Unfortunately, my
attempts to turn the integer it returns into a date have failed.

>>> os.path.getctime(fn)    #fn was created today, 1/17/2007
1168955503

I tried to convert this to a date object by typing
>>>datetime.date.fromordinal(1168955503)

Traceback (most recent call last):
  File "<pyshell#9>", line 1, in -toplevel-
    datetime.date.fromordinal(1168955503)
ValueError: year is out of range

How can I do the conversion? I'm trying to identify all files that were
created after YYYY/MM/DD.

For a quick sanity check, I ran
>>> datetime.date.today().toordinal()
732693

which is orders of magnitude smaller than the number returned by
os.path.getctime(fn).

Thanks in advance for your help

Thomas Philips

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to