logilab-common #280794 utcdatetime problem with tz-ed datetimes [validation pending]

The utcdatetime implementation mess-up the datetime if it has a tzinfo.

The following code illustrate the problem:

>>> import dateutil.parser
>>> from logilab.common.date import utcdatetime
>>> d = dateutil.parser.parse('2014-11-12T12:00:00Z')
>>> print d
2014-11-12 12:00:00+00:00
>>> print repr(d)
datetime.datetime(2014, 11, 12, 12, 0, tzinfo=tzutc())
>>> d = utcdatetime(d)
>>> print repr(d)
datetime.datetime(2014, 11, 12, 12, 0, 0, 2)

The last datetime should have been datetime.datetime(2014, 11, 12, 12).

prioritynormal
typebug
done in0.63.1
load left0.000
closed by#123b72695560 [date] Fix utcdatetime
patch[date] Fix utcdatetime [applied]