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 :-(

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <mailinglists@vanwingerde.nl>
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; 'modified': 0.07; 'python': 0.11; 'jan': 0.12; '2.7.3': 0.16; 'bericht': 0.16; 'mtime': 0.16; 'skip:t 110': 0.16; '>>>': 0.22; 'import': 0.22; '+0000': 0.22; 'compare': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'received:10.0.0': 0.31; 'os,': 0.31; 'subject:time': 0.33; 'charset:us-ascii': 0.36; 'received:10.0': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'more': 0.64; 'results': 0.69; 'received:nl': 0.74; '2013,': 0.91
DKIM-Signature v=1; a=rsa-sha1; c=relaxed; d=vanwingerde.nl; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=postfix; bh=RhuwPVH9P +LZjTFMl932WXyMKfM=; b=kmrxNjPA3ewZ85Vlce9ARxoi4knSlhoOwVNE8GeWf AdycUGhlg0wAL3khCM/3nlUcxXvsul42uj7n8+TDhz5GLuB4mpMuN/BQ3ggtJtV1 iMVT6KEH4aCJz5UcKn7Wlw+VLR6NviH1Tf5tcVtwE3jtDlW3AfuVQZsrwKvgq6Gn 7o=
DomainKey-Signature a=rsa-sha1; c=nofws; d=vanwingerde.nl; h=date:from :to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=postfix; b=eAH 2ZLxxHp4pbBc/hpeYFkLhCgKreJqMj8mnhD8wiFEQxYPqAhW/TJ4M9lFd0IQbFnL u2CpbjW3TXD1SQqHPSDRW0hna+4SiMUPDA9ND1RmEnsOHhkXSZjXJL5V7SSEUkrU i4soxje5w78JV/vOYnXkWsGUsR1Suq24PZ0I6rxs=
Date Mon, 3 Mar 2014 14:28:21 +0000
From Jaap van Wingerde <mailinglists@vanwingerde.nl>
To python-list@python.org
Subject Re: modification time in Python - Django: datetime != datetime :-(
In-Reply-To <CAPTjJmrp9Ca5zyfo75NKcX_ik0Qi4kOcjhhY6EEWKQ-xJx7KQg@mail.gmail.com>
References <20140303133541.66fccbbb@lia.custard.shrl.nl> <CAPTjJmrp9Ca5zyfo75NKcX_ik0Qi4kOcjhhY6EEWKQ-xJx7KQg@mail.gmail.com>
Organization Yellow matter custard
X-Mailer Claws Mail 3.7.6 (GTK+ 2.20.1; i486-pc-linux-gnu)
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7646.1393856904.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1393856904 news.xs4all.nl 2859 [2001:888:2000:d::a6]:49405
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67554

Show key headers only | 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