Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp doesn't correctly localize datetime.date #2993

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

Comments

@petergx
Copy link

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>
@waitingkuo

This comment has been minimized.

Copy link
Contributor

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

@ghost

This comment has been minimized.

Copy link

commented Mar 21, 2013

PR merged, fixed in master with 2998540.

@ghost ghost closed this Mar 21, 2013

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.