-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Adding DateOffset(days=1) produces NonExistentTimeError #12156
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
Comments
use this
though this might be a bug as |
I poked into this a bit. I haven't solved it yet, but the error happens in
In the original example, when you add a |
this is in the .applly method of DateOffset which doesn't correctly deal with localization Day does this correctly (so u can use that code / move to DateOffset) the trick is to know exactly when to call this |
What is done for most offsets is to remove the tz entirely which makes additions of months/quarters/weeks/etc. work fine across tz boundaries. However, with day the logic does need to be changed a bit. Right now |
There are some other weird things here, probably separate issues: This time doesn't exist yet one can create it.
Again, doesn't exist, but doesn't fail
|
And I think the right answer rather than going to UTC, is not removing the tz at all for offsets <= day. I think there is already this capability in |
@rockg A wholly different (and maybe better method) of handling all of this is to add a |
This doesn't seem to be related to |
daylight saving |
Ah, that's what I was missing. Thanks! No wonder this is so confusing. |
http://www.timeanddate.com/time/zone/usa/new-york 2015 Sun, Mar 8, 2:00 AM EST → EDT +1 hour (DST start) UTC-4h This seem to be the expected behaviour. |
Closing as this looks like a duplicate of #28610 |
INSTALLED VERSIONS
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-61-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.17.1
nose: None
pip: 7.1.0
setuptools: 18.0.1
Cython: None
numpy: 1.10.4
scipy: 0.16.1
statsmodels: None
IPython: 4.0.3
sphinx: None
patsy: None
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.0
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
Jinja2: None
The text was updated successfully, but these errors were encountered: