-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Bad shift_forward ceiling around DST change #51501
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
take |
The result "2023-03-26 03:00:00" is expected because when you shift 00:45:00 forwards by 30 mins, it becomes 01:15:00 which is actually 02:15:00 in London DST time. Ceiling it will return 03:00:00. Hope it helps or please correct me if I am wrong. |
I don't get it, even if we forget the DST: If the correct answer is |
thanks for the report - I think I would also have expected |
Thank you both for the clarification. After I read more closely to the documentation, I think you are right that the expected result should be |
that would be great, thank you! feel free to ping if anything trips you up |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
On March 26th 2023 London will switch to its DST time and goes directly from 00:59.99 to 02:00:00 skipping 1h of local time.
Unfortunately, ceiling 00:45:00 to its upper hour results into 03:00:00.
Expected Behavior
2023-03-26 02:00:00
Installed Versions
pandas : 1.5.3
numpy : 1.23.5
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 65.3.0
pip : 22.2.2
Cython : 0.29.30
pytest : 7.2.1
hypothesis : None
sphinx : 4.5.0
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.9.0
html5lib : None
pymysql : None
psycopg2 : 2.9.3
jinja2 : 3.1.1
IPython : 8.2.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli : None
fastparquet : None
fsspec : 2022.3.0
gcsfs : None
matplotlib : 3.5.1
numba : 0.56.4
numexpr : None
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : 7.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.8.1
snappy : None
sqlalchemy : 1.4.41
tables : None
tabulate : 0.8.9
xarray : 2022.3.0
xlrd : 2.0.1
xlwt : None
zstandard : None
tzdata : None
The text was updated successfully, but these errors were encountered: