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


Groups > comp.lang.python > #67554

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

Date 2014-03-03 14:28 +0000
From Jaap van Wingerde <mailinglists@vanwingerde.nl>
Subject Re: modification time in Python - Django: datetime != datetime :-(
References <20140303133541.66fccbbb@lia.custard.shrl.nl> <CAPTjJmrp9Ca5zyfo75NKcX_ik0Qi4kOcjhhY6EEWKQ-xJx7KQg@mail.gmail.com>
Organization Yellow matter custard
Newsgroups comp.lang.python
Message-ID <mailman.7646.1393856904.18130.python-list@python.org> (permalink)

Show all headers | View raw


Op <Tue, 4 Mar 2014 01:08:52 +1100> schreef Chris Angelico <rosuav@gmail.com> in bericht <CAPTjJmrp9Ca5zyfo75NKcX_ik0Qi4kOcjhhY6EEWKQ-xJx7KQg@mail.gmail.com>:

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

jaap@liakoster:~$ python
Python 2.7.3 (default, Jan  2 2013, 13:56:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, time
>>> from time import gmtime
>>> 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'
>>> time.strftime('%Y-%m-%dT%H:%m:%SZ',gmtime(os.path.getctime('/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
jaap@liakoster:~$ 

ls is giving me the modified time.

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


Thread

Re: modification time in Python - Django: datetime != datetime :-( Jaap van Wingerde <mailinglists@vanwingerde.nl> - 2014-03-03 14:28 +0000
  Re: modification time in Python - Django: datetime != datetime :-( donarb <donarb@nwlink.com> - 2014-03-03 12:22 -0800
    Re: modification time in Python - Django: datetime != datetime :-( Chris Angelico <rosuav@gmail.com> - 2014-03-04 08:11 +1100
    Re: modification time in Python - Django: datetime != datetime :-( Jaap van Wingerde <mailinglists@vanwingerde.nl> - 2014-03-04 10:33 +0000
      Re: modification time in Python - Django: datetime != datetime :-( donarb <donarb@nwlink.com> - 2014-03-04 08:45 -0800
        Re: modification time in Python - Django: datetime != datetime :-( Roy Smith <roy@panix.com> - 2014-03-04 12:43 -0500

csiph-web