Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.news.ox.ac.uk!news.ox.ac.uk!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Django': 0.03; 'subject:Python': 0.06; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mtime': 0.16; 'skip:t 110': 0.16; 'wrote:': 0.18; '+0000': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'compare': 0.26; 'van': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; '>>>>': 0.31; 'subject:time': 0.33; 'received:google.com': 0.35; 'rather': 0.38; 'mar': 0.68; 'results': 0.69; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=Zs9EluhXY+wmHUZvH3Wn5M+lEbqasXrPVEZJ89JZ4+s=; b=aElYgyRmguYnpvuMLvK/FPMW/enK153WObM0N2tvtWMfMtrMmUi69bBGS9rRXNnwCA 7xG+qQtZtWtK3P9P0F/TnbQVixfrICX254FtFde1d2pDRJVc7NTQS+MIVe/30pEg3J5+ vfVaCCpojJ3L7jYOAfBfzoPH6vkjqBW8QMc+cHABGGRLbJ5IKSbiPuTd63P6Ec1wduEj /XWvcQeq5JHj4v4RuQSTRLELb6vE8ZWOlBUhpMm7OIBtCBnzLf1+nb5uwntxd3iQ89f8 HZ9CJ6Mi68P9PyXajvDzFVpaTdaH8GjHVIXrBuyfPIY9cKpjepxNbFRJmsQnAcEkzONe hpaw== MIME-Version: 1.0 X-Received: by 10.68.248.7 with SMTP id yi7mr11767405pbc.31.1393855733040; Mon, 03 Mar 2014 06:08:53 -0800 (PST) In-Reply-To: <20140303133541.66fccbbb@lia.custard.shrl.nl> References: <20140303133541.66fccbbb@lia.custard.shrl.nl> Date: Tue, 4 Mar 2014 01:08:52 +1100 Subject: Re: modification time in Python - Django: datetime != datetime :-( From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393855743 news.xs4all.nl 2901 [2001:888:2000:d::a6]:33127 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67548 On Tue, Mar 4, 2014 at 12:35 AM, Jaap van Wingerde 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