Timestamp doesn't correctly localize datetime.date #2993

Closed
petergx opened this Issue Mar 9, 2013 · 2 comments

Comments

Projects
None yet
3 participants

petergx commented Mar 9, 2013

In 0.10.1, Timestamp constructor seems to have an issue localizing datetime.date objects.

In [19]: import datetime

In [20]: datetime.date(2013, 3, 9)
Out[20]: datetime.date(2013, 3, 9)

In [21]: d=datetime.date(2013, 3, 9)

In [22]: Timestamp(d, tz='US/Pacific') == Timestamp(d).tz_localize('US/Pacific')
Out[22]: False

In [23]: Timestamp(d, tz='US/Pacific')
Out[23]: <Timestamp: 2013-03-08 16:00:00-0800 PST, tz=US/Pacific>
Contributor

waitingkuo commented Mar 11, 2013

The constructor of Timestamp accidentally does different jobs for datetime.date and datetime.datetime I've solved it, and sent a pull request

Contributor

y-p commented Mar 21, 2013

PR merged, fixed in master with 2998540.

y-p closed this Mar 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment