Closed mostafabarmshory closed 1 year ago
I can fix this issue by my self, if you help me to know how. Would you please?
Hello @mostafabarmshory I was having a similar issue, also created a issue explaining the problem https://github.com/stub42/pytz/issues/107, on the issue I informed that there is a workaround that can be used, please take a look maybe it can help you as well, hope this issue is fixed in the future.
I have the same problem. No one has a solution for it?
Here is a PR waiting for approve.
pytz is working as expected. Make sure you are constructing localized timestamps correctly, per the pytz README
Python 3.8.10 (default, Nov 14 2022, 12:59:47)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytz
>>> from datetime import datetime
>>> tz = pytz.timezone('Asia/Tehran')
>>> tz.localize(datetime.now())
datetime.datetime(2023, 8, 13, 13, 8, 24, 779310, tzinfo=<DstTzInfo 'Asia/Tehran' +0330+3:30:00 STD>)
>>>
@stub42
Which version did you use? In my version it is not correct?!
Name: pytz
Version: 2021.1
Summary: World timezone definitions, modern and historical
Home-page: http://pythonhosted.org/pytz
Author: Stuart Bishop
Author-email: stuart@stuartbishop.net
License: MIT
Location: /home/maso/Git/odoo/odoo_16/.venv/lib/python3.10/site-packages
Requires:
Required-by: Babel, odoo, zeep
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> import pytz
>>> tz = pytz.timezone('Asia/Tehran')
>>> tz.localize(datetime.now())
datetime.datetime(2023, 9, 5, 18, 40, 53, 184396, tzinfo=<DstTzInfo 'Asia/Tehran' +0430+4:30:00 DST>)
pytz 2021.1 was released in 2021. You want the latest version with the latest database (2023.3)
Dear developers,
I was faced with an issue. I use Asia/Tehran or Iran as the time zone. I expect +3:30 but the result is +4:30.
How can I fix this?