Browse Source

Timezone

pull/28/head
Jure Šorn 6 years ago
parent
commit
c7e67edc56
1 changed files with 5 additions and 1 deletions
  1. 6
      README.md

6
README.md

@ -462,7 +462,7 @@ Datetime
```python ```python
from datetime import date, time, datetime, timedelta from datetime import date, time, datetime, timedelta
from dateutil.tz import UTC, gettz
from dateutil.tz import UTC, tzlocal, gettz
``` ```
### Constructors ### Constructors
@ -486,7 +486,11 @@ from dateutil.tz import UTC, gettz
### Timezone ### Timezone
```python ```python
<tz> = UTC # UTC timezone. <tz> = UTC # UTC timezone.
<tz> = tzlocal() # Local timezone.
<tz> = gettz('<Cont.>/<City>') # Timezone from 'Continent/City_Name' str. <tz> = gettz('<Cont.>/<City>') # Timezone from 'Continent/City_Name' str.
```
```python
<DTa> = <DT>.astimezone(<tz>) # Datetime, converted to passed timezone. <DTa> = <DT>.astimezone(<tz>) # Datetime, converted to passed timezone.
<Ta/DTa> = <T/DT>.replace(tzinfo=<tz>) # Unconverted object with new timezone. <Ta/DTa> = <T/DT>.replace(tzinfo=<tz>) # Unconverted object with new timezone.
``` ```

Loading…
Cancel
Save