Confusing datetime.datetime

Damjan gdamjan at gmail.com
Thu Jul 5 18:55:48 EDT 2012


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???




More information about the Python-list mailing list