Python dealing with dates and times

Posted by randombits on Stack Overflow See other posts from Stack Overflow or by randombits
Published on 2010-03-31T19:32:08Z Indexed on 2010/03/31 19:43 UTC
Read the original article Hit count: 437

Filed under:

I'm looking for a solution to the following:

Given today's date, figure out what month was before. So 2 should return for today, since it is currently March, the third month of the year. 12 should return for January.

Then based on that, I need to be able to iterate through a directory and find all files that were created that month.

Bonus points would include finding the most current file created for the previous month.

© Stack Overflow or respective owner

Related posts about python