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

BUG: Possible BMonthEnd() #4069

Closed
BMeridian opened this issue Jun 28, 2013 · 1 comment · Fixed by #6743
Closed

BUG: Possible BMonthEnd() #4069

BMeridian opened this issue Jun 28, 2013 · 1 comment · Fixed by #6743
Labels
Bug Datetime Datetime data dtype Frequency DateOffsets
Milestone

Comments

@BMeridian
Copy link

>>> import datetime as dt
>>> from pandas.tseries.offsets import *
>>> d = dt.datetime(2013, 6, 27, 8, 10)
>>> d + BMonthEnd()
datetime.datetime(2013, 6, 28, 0, 0) # correct!!!
>>> d = dt.datetime(2013, 6, 28, 8, 10)
>>> d + BMonthEnd()
datetime.datetime(2013, 7, 31, 0, 0) ## should 6/28 not 7/31...day not over
@jreback
Copy link
Contributor

jreback commented Mar 30, 2014

In [17]: d
Out[17]: datetime.datetime(2013, 6, 28, 8, 10)

In [18]: d + BDay()
Out[18]: Timestamp('2013-07-01 08:10:00')

In [19]: d + BDay(0)
Out[19]: Timestamp('2013-06-28 08:10:00')

In [20]: d + BMonthEnd(0)
Out[20]: Timestamp('2013-06-28 00:00:00')

In [21]: d + BMonthEnd(1)
Out[21]: datetime.datetime(2013, 7, 31, 0, 0)

I think this is correct, it is advancing to the next month end (you can specify 0 if you don't want that).

exposed a different issue though, this should be returning Timestamps.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Frequency DateOffsets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants