@ -563,7 +563,7 @@ from dateutil.tz import UTC, tzlocal, gettz
<DTn> = DT.utcnow() # Naive datetime from current UTC time.
<DTa> = DT.now(<tzinfo>) # Aware datetime from current tz time.
```
* **To extract time use `'<DTn>.time()'` or `'<DTa>.timetz()'`.**
* **To extract time use `'<DTn>.time()'`, `'<DTa>.time()'` or `'<DTa>.timetz()'`.**
### Timezone
```python
@ -581,8 +581,9 @@ from dateutil.tz import UTC, tzlocal, gettz
```python
<D/T/DT> = D/T/DT.fromisoformat('<iso>') # Object from ISO string.
<DT> = DT.strptime(<str>, '<format>') # Datetime from str, according to format.
<D/DTn> = D/DT.fromordinal(<int>) # D/DTn from days since Christ.
<DTa> = DT.fromtimestamp(<real>, <tz.>) # DTa from seconds since Epoch in tz time.
<D/DTn> = D/DT.fromordinal(<int>) # D/DTn from days since Christ, at midnight.
<DTn> = DT.fromtimestamp(<real>) # Local time DTn from seconds since Epoch.
<DTa> = DT.fromtimestamp(<real>, <tz.>) # Aware datetime from seconds since Epoch.
```
* **ISO strings come in following forms: `'YYYY-MM-DD'`, `'HH:MM:SS.ffffff[±<offset>]'`, or both separated by `'T'`. Offset is formatted as: `'HH:MM'`.**
* **On Unix systems Epoch is `'1970-01-01 00:00 UTC'`, `'1970-01-01 01:00 CET'`, ...**
@ -592,7 +593,8 @@ from dateutil.tz import UTC, tzlocal, gettz
<str> = <D/T/DT>.isoformat() # ISO string representation.
<DTa> = DT.now(<tzinfo>) <spanclass="hljs-comment"># Aware datetime from current tz time.</span>
</code></pre>
<ul>
<li><strong>To extract time use <codeclass="python hljs"><spanclass="hljs-string">'<DTn>.time()'</span></code> or <codeclass="python hljs"><spanclass="hljs-string">'<DTa>.timetz()'</span></code>.</strong></li>
<li><strong>To extract time use <codeclass="python hljs"><spanclass="hljs-string">'<DTn>.time()'</span></code>, <codeclass="python hljs"><spanclass="hljs-string">'<DTa>.time()'</span></code> or <codeclass="python hljs"><spanclass="hljs-string">'<DTa>.timetz()'</span></code>.</strong></li>
</ul>
<h3id="timezone">Timezone</h3>
<pre><codeclass="python language-python hljs"><tzinfo> = UTC <spanclass="hljs-comment"># UTC timezone. London without DST.</span>
@ -615,18 +615,20 @@ shuffle(<list>)
<h3id="encode">Encode</h3>
<pre><codeclass="python language-python apache hljs"><D/T/DT> = D/T/DT.fromisoformat(<spanclass="hljs-string">'<iso>'</span>) <spanclass="hljs-comment"># Object from ISO string.</span>
<DT> = DT.strptime(<str>, <spanclass="hljs-string">'<format>'</span>) <spanclass="hljs-comment"># Datetime from str, according to format.</span>
<D/DTn> = D/DT.fromordinal(<int>) <spanclass="hljs-comment"># D/DTn from days since Christ.</span>
<DTa> = DT.fromtimestamp(<real>, <tz.>) <spanclass="hljs-comment"># DTa from seconds since Epoch in tz time.</span>
<D/DTn> = D/DT.fromordinal(<int>) <spanclass="hljs-comment"># D/DTn from days since Christ, at midnight.</span>
<DTn> = DT.fromtimestamp(<real>) <spanclass="hljs-comment"># Local time DTn from seconds since Epoch.</span>
<DTa> = DT.fromtimestamp(<real>, <tz.>) <spanclass="hljs-comment"># Aware datetime from seconds since Epoch.</span>
</code></pre>
<ul>
<li><strong>ISO strings come in following forms: <codeclass="python hljs"><spanclass="hljs-string">'YYYY-MM-DD'</span></code>, <codeclass="python hljs"><spanclass="hljs-string">'HH:MM:SS.ffffff[±<offset>]'</span></code>, or both separated by <codeclass="python hljs"><spanclass="hljs-string">'T'</span></code>. Offset is formatted as: <codeclass="python hljs"><spanclass="hljs-string">'HH:MM'</span></code>.</strong></li>
<li><strong>On Unix systems Epoch is <codeclass="python hljs"><spanclass="hljs-string">'1970-01-01 00:00 UTC'</span></code>, <codeclass="python hljs"><spanclass="hljs-string">'1970-01-01 01:00 CET'</span></code>, …</strong></li>
</ul>
<h3id="decode">Decode</h3>
<pre><codeclass="python language-python apache hljs"><str> = <D/T/DT>.isoformat() <spanclass="hljs-comment"># ISO string representation.</span>
<pre><codeclass="python language-python hljs"><str> = <D/T/DT>.isoformat() <spanclass="hljs-comment"># ISO string representation.</span>