File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -461,9 +461,8 @@ Datetime
461
461
* ** If object is naive it is presumed to be in system's timezone.**
462
462
463
463
``` python
464
- # $ pip3 install pytz
465
464
from datetime import date, time, datetime, timedelta
466
- import pytz
465
+ from dateutil.tz import UTC , gettz
467
466
```
468
467
469
468
### Constructors
@@ -486,8 +485,8 @@ import pytz
486
485
487
486
### Timezone
488
487
``` python
489
- < tz> = pytz.utc # UTC timezone.
490
- < tz> = pytz.timezone (' <Cont.>/<City>' ) # Timezone from 'Continent/City_Name' str.
488
+ < tz> = UTC # UTC timezone.
489
+ < tz> = gettz (' <Cont.>/<City>' ) # Timezone from 'Continent/City_Name' str.
491
490
< DTa> = < DT > .astimezone(< tz> ) # Datetime, converted to passed timezone.
492
491
< Ta/ DTa> = < T/ DT > .replace(tzinfo = < tz> ) # Unconverted object with new timezone.
493
492
```
You can’t perform that action at this time.
0 commit comments