how to filter files by creation date

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue Nov 6 11:27:49 CET 2007


On Tue, 06 Nov 2007 01:45:02 -0800, awel wrote:

> On 6 nov, 09:00, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
>> On Mon, 05 Nov 2007 23:33:16 -0800, awel wrote:
>> > I am trying to to make a script to move all the files that has been
>> > created at today's to another folder but my problem is the date format
>> > that I receive from the 'os.stat  [stat.ST_CTIME]' is different from
>> > the one that I receive from the 'datetime.date.today()'.
>>
>> Build a `datetime.date` object from the timestamp you get from the stat
>> call:
>>
>> In [438]: !touch test.py
>>
>> In [439]: datetime.date.fromtimestamp(os.stat('/home/bj/test.py').st_ctime)
>> Out[439]: datetime.date(2007, 11, 6)
>>
>> Ciao,
>>         Marc 'BlackJack' Rintsch
> 
> Could you explain a little more because I am new in scripting?

Not really.  I showed you the call I made and the result I got.  How can I
be more clear and precise!?

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list