Confusing datetime.datetime

Damjan gdamjan at
Fri Jul 6 00:55:48 CEST 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 =
x2 = datetime(x1.year, x1.month,, tzinfo=TZ)

assert x1.tzinfo == x2.tzinfo

WHY does the assert throw an error???

More information about the Python-list mailing list