Skip to content

Commit ce9f37f

Browse files
committed
bug fix
1 parent 09beaa3 commit ce9f37f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ The `JalaliDateTime` object represents a date and time in the Jalali calendar.
104104

105105
```python
106106
>>> from persiantools.jdatetime import JalaliDateTime
107-
>>> import datetime, pytz
107+
>>> import datetime
108108

109109
# Current Jalali datetime
110110
>>> JalaliDateTime.now()
111111
JalaliDateTime(1404, 3, 16, 2, 17, 14, 907909)
112112

113-
# Current Jalali datetime (timezone-aware)
114-
>>> JalaliDateTime.now(pytz.timezone("Asia/Tehran"))
115-
JalaliDateTime(1404, 3, 16, 2, 17, 14, 907909, tzinfo=<DstTzInfo 'Asia/Tehran' +0330+3:30:00 STD>)
113+
>>> from zoneinfo import ZoneInfo
114+
>>> JalaliDateTime.now(ZoneInfo("Asia/Tehran"))
115+
JalaliDateTime(1404, 3, 16, 2, 17, 14, 907909, tzinfo=zoneinfo.ZoneInfo(key='Asia/Tehran'))
116116

117117
# Current UTC Jalali datetime
118118
>>> JalaliDateTime.utcnow()
@@ -132,20 +132,21 @@ JalaliDateTime(1367, 2, 14, 14, 30, 15)
132132
JalaliDateTime(1400, 1, 1, 15, 30, 0, 10)
133133

134134
# Timezone conversion
135-
>>> tehran_tz = pytz.timezone("Asia/Tehran")
136-
>>> utc_tz = pytz.utc
135+
>>> from zoneinfo import ZoneInfo
136+
>>> tehran_tz = ZoneInfo("Asia/Tehran")
137+
>>> utc_tz = datetime.timezone.utc
137138
>>> dt_utc = JalaliDateTime.now(utc_tz)
138139
>>> dt_tehran = dt_utc.astimezone(tehran_tz)
139140
>>> dt_utc
140-
JalaliDateTime(1404, 3, 15, 22, 54, 8, 835877, tzinfo=<UTC>)
141+
JalaliDateTime(1404, 3, 15, 22, 54, 8, 835877, tzinfo=datetime.timezone.utc)
141142
>>> dt_tehran
142-
JalaliDateTime(1404, 3, 16, 2, 24, 8, 835877, tzinfo=<DstTzInfo 'Asia/Tehran' +0330+3:30:00 STD>)
143+
JalaliDateTime(1404, 3, 16, 2, 24, 8, 835877, tzinfo=zoneinfo.ZoneInfo(key='Asia/Tehran'))
143144
```
144145

145146
#### Attributes and Methods
146147

147148
```python
148-
>>> dt_obj = JalaliDateTime(1367, 2, 14, 14, 30, 15, 123, tzinfo=pytz.utc)
149+
>>> dt_obj = JalaliDateTime(1367, 2, 14, 14, 30, 15, 123, tzinfo=datetime.timezone.utc)
149150

150151
>>> dt_obj.year
151152
1367
@@ -162,7 +163,7 @@ JalaliDateTime(1404, 3, 16, 2, 24, 8, 835877, tzinfo=<DstTzInfo 'Asia/Tehran' +0
162163
>>> dt_obj.microsecond
163164
123
164165
>>> dt_obj.tzinfo
165-
<UTC>
166+
datetime.timezone.utc
166167

167168
# Date part as datetime.date (Gregorian)
168169
>>> dt_obj.date()
@@ -183,9 +184,9 @@ Based on python `strftime()` behavior
183184

184185
```python
185186
>>> from persiantools.jdatetime import JalaliDateTime
186-
>>> import pytz
187+
>>> from zoneinfo import ZoneInfo
187188

188-
>>> dt = JalaliDateTime(1367, 2, 14, 14, 30, 0, tzinfo=pytz.timezone("Asia/Tehran"))
189+
>>> dt = JalaliDateTime(1367, 2, 14, 14, 30, 0, tzinfo=ZoneInfo("Asia/Tehran"))
189190

190191
>>> dt.strftime("%Y/%m/%d %H:%M:%S")
191192
'1367/02/14 14:30:00'
@@ -302,6 +303,7 @@ JalaliDate(1367, 2, 14, Chaharshanbeh)
302303
If you find this project helpful and would like to support its continued development, please consider donating.
303304

304305
* **Bitcoin (BTC):** `bc1qg5rp7ymznc98wmhltzvpwl2dvfuvjr33m4hy77`
306+
* **Ethereum (ETH):** `0xC7D6bf306E456632764D0aD111C8dBBb43a3B9ad`
305307
* **Tron (TRX):** `TDd63bVWZDBHmwVNFgJ6T2WdWmk9z7PBLg`
306308
* **Stellar (XLM):** `GDSFPPLY34QSAOTOP4DQDXAI2YDRNRIADZHTN3HCGMQXRLIGPYOEH7L5`
307309
* **Solana (SOL):** `CXHKgCBqBYy1hbZKGqaSmMzQoTC4Wx2v8QfL9Z7JBo3A`

0 commit comments

Comments
 (0)