On Monday, March 3, 2014 6:28:21 AM UTC-8, Jaap van Wingerde wrote: > Op <Tue, 4 Mar 2014 01:08:52 +1100> schreef Chris Angelico <ros...@gmail.com> > in bericht > <captjjmrp9ca5zyfo75nkcx_ik0qi4kocjhhy6eewkq-xjx7...@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.
You're using the months format '%m' when you should be using minutes '%M'. -- https://mail.python.org/mailman/listinfo/python-list