Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #67548

Re: modification time in Python - Django: datetime != datetime :-(

References <20140303133541.66fccbbb@lia.custard.shrl.nl>
Date 2014-03-04 01:08 +1100
Subject Re: modification time in Python - Django: datetime != datetime :-(
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.7642.1393855743.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Mar 4, 2014 at 12:35 AM, Jaap van Wingerde
<mailinglists@vanwingerde.nl> wrote:
>>>> time.strftime('%Y-%m-%dT%H:%m:%SZ',gmtime(os.path.getmtime('/var/django/test2/art/templates/art_index.html')))
> '2014-03-02T19:03:55Z'
>>>> quit()
> jaap@liakoster:~$ ls --full-time /var/django/test2/art/templates/art_index.html
> -rwxrwx--- 1 lia www-data 2456 2014-03-02 19:16:55.568139590 +0000 /var/django/test2/art/templates/art_index.html

See if ls is actually giving you ctime rather than mtime - compare the
results if you ask for os.path.getctime.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: modification time in Python - Django: datetime != datetime :-( Chris Angelico <rosuav@gmail.com> - 2014-03-04 01:08 +1100

csiph-web