Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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; 'python,': 0.02; 'explicitly': 0.05; 'subject:Python': 0.06; 'received:198': 0.07; 'python': 0.11; '"an': 0.16; 'finney': 0.16; 'helps.': 0.16; 'how,': 0.16; 'none.': 0.16; 'roy': 0.16; 'utc': 0.16; 'header :User-Agent:1': 0.23; 'tells': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'object.': 0.31; 'writes:': 0.31; 'skip:d 20': 0.34; 'subject:the': 0.34; 'no,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'object,': 0.36; 'ben': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'hope': 0.61; 'smith': 0.68; 'message-id:@mx.google.com': 0.80; 'asked.': 0.84; 'skip:\xe2 30': 0.91; 'obtained': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=j2h39lpSdqQNbK5su5U0DStPDPPhXAYE46BqT5y1728=; b=aPV4d2JT7FrqSAQRQOQ91uIQrtnAtnZDc+c29lymj3pR+FzVvgbJhQcqEtNU0DdEiv MqPUuotx03mjyiIJGZy3sPQBuI1ViAjjdiRVL+2PK/YtaVrDbH7gLn6sPt+O5QLNrgpj UxxQY7AWPYn5aosUVDyj2KT5O4WOP09/jdZmQlccntTLIr1PW73JGAiWfBf6yZuol1Mk NuxbGdQyZ6RdOLu++ZZ9qVyxbyaWTwx+jmemWUe/hdSfakAjBVKhYf28V84KlF5Fs7JD 3XB0CH+u+hLePhXBpc/Sfih6QQKx77w6or22WBq/AZQHAtQm7mW+7PzSslsH3dfQEdxn UKDA== X-Received: by 10.49.108.200 with SMTP id hm8mr4943470qeb.53.1389259320866; Thu, 09 Jan 2014 01:22:00 -0800 (PST) From: Kushal Kumaran To: python-list@python.org Subject: Re: the Gravity of Python 2 In-Reply-To: <7w8uupedd5.fsf@benfinney.id.au> References: <78d91$52cbf8e9$541826b9$29485@cache1.tilbu1.nb.home.nl> <4b702$52cc262e$541826b9$22985@cache80.multikabel.net> <4cbf$52cc2e82$541826b9$11761@cache70.multikabel.net> <686$52cd4640$541826b9$21896@cache1.tilbu1.nb.home.nl> <52ce3c6d.8814e00a.3abb.ffff86a7@mx.google.com> <7w8uupedd5.fsf@benfinney.id.au> User-Agent: Notmuch/0.17+7~gc734dd7 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Thu, 09 Jan 2014 14:51:51 +0530 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389259324 news.xs4all.nl 2965 [2001:888:2000:d::a6]:47510 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63587 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ben Finney writes: > Kushal Kumaran writes: > >> Roy Smith writes: >> > How, in Python, do you get an aware UTC datetime object? >> >> My local copy of the python 3.2.3 docs says: >> >> classmethod datetime.utcnow() >> >> Return the current UTC date and time, with tzinfo None. This is >> like now(), but returns the current UTC date and time, as a naive >> datetime object. An aware current UTC datetime can be obtained by >> calling datetime.now(timezone.utc). See also now(). >> >> Hope this helps. > > No, that won't do what was asked. The =E2=80=98datetime.datetime.utcnow= =E2=80=99 > function explicitly returns a naive datetime object, not an aware > datetime object. > Yes, but the documentation for utcnow explicitly tells you how to get an aware object. "An aware current UTC datetime can be obtained by calling datetime.now(timezone.utc)." =2D-=20 regards, kushal --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAEBAgAGBQJSzmovAAoJEKolkdITDqLtSj4H/RZx387QSKKdGp3dPTjs2JpQ Aa7la3oSW2XH0Ans80b7B8PdRsbe+vV68s9qAHMt9DoBwLY41bjdFeCEtXCf1VBF wScK9musFy/Q2DD1vOp7wRSanTt+3FIWWpYIwaGRlA35xdA6Wtndjd4VilgFk6MM jkFbq8UX3m8512sr75HJqXxVYdWvfQ5g0m7V4YJYE73KpCFQVwBIdF6skMmfquvH gqwBm9w5dWSU53SUvKUEUTLRib8SSxveu8C2BE+X5I9ALNrlAbCd1X9/LkfEFIaD mq6XCKfs+TWWDuqF5HLms7x+zZ7GZ6Mi+DlZzsTr76JXZ5hszSIqgUQWnmAQEzY= =OUN8 -----END PGP SIGNATURE----- --=-=-=--