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


Groups > comp.lang.python > #24948

Re: Confusing datetime.datetime

From Damjan <gdamjan@gmail.com>
Subject Re: Confusing datetime.datetime
Date 2012-07-06 00:55 +0200
References <jt4766$og9$1@dough.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.1843.1341528901.4697.python-list@python.org> (permalink)

Show all headers | View raw


On 05.07.2012 16:10, Damjan wrote:
> I've been struggling with an app that uses
> Postgresql/Psycopg2/SQLAlchemy  and I've come to this confusing
> behaviour of datetime.datetime.


Also this:

#! /usr/bin/python2
# retardations in python's datetime

import pytz
TZ = pytz.timezone('Europe/Skopje')

from datetime import datetime

x1 = datetime.now(tz=TZ)
x2 = datetime(x1.year, x1.month, x1.day, tzinfo=TZ)

assert x1.tzinfo == x2.tzinfo


WHY does the assert throw an error???

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


Thread

Re: Confusing datetime.datetime Damjan <gdamjan@gmail.com> - 2012-07-06 00:55 +0200
  Re: Confusing datetime.datetime Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-06 01:28 +0000
    Re: Confusing datetime.datetime Damjan <gdamjan@gmail.com> - 2012-07-06 04:05 +0200
  Re: Confusing datetime.datetime Hans Mulder <hansmu@xs4all.nl> - 2012-07-06 18:41 +0200
    Re: Confusing datetime.datetime Damjan <gdamjan@gmail.com> - 2012-07-08 23:49 +0200

csiph-web