You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><strong>Module 'datetime' provides 'date' <codeclass="python hljs"><D></code>, 'time' <codeclass="python hljs"><T></code>, 'datetime' <codeclass="python hljs"><DT></code> and 'timedelta' <codeclass="python hljs"><TD></code> classes. All are immutable and hashable.</strong></li>
464
-
<li><strong>Time and datetime can be 'aware' <codeclass="python hljs"><a></code>, meaning they have defined timezone, or 'naive' <codeclass="python hljs"><n></code>, meaning they don't.</strong></li>
463
+
<li><strong>Module 'datetime' provides 'date' <codeclass="apache hljs"><spanclass="hljs-section"><D></span></code>, 'time' <codeclass="apache hljs"><spanclass="hljs-section"><T></span></code>, 'datetime' <codeclass="apache hljs"><spanclass="hljs-section"><DT></span></code> and 'timedelta' <codeclass="apache hljs"><spanclass="hljs-section"><TD></span></code> classes. All are immutable and hashable.</strong></li>
464
+
<li><strong>Time and datetime can be 'aware' <codeclass="apache hljs"><spanclass="hljs-section"><a></span></code>, meaning they have defined timezone, or 'naive' <codeclass="apache hljs"><spanclass="hljs-section"><n></span></code>, meaning they don't.</strong></li>
465
465
<li><strong>If object is naive it is presumed to be in system's timezone.</strong></li>
466
466
</ul>
467
467
<pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> datetime <spanclass="hljs-keyword">import</span> date, time, datetime, timedelta
<Ta/DTa> = <T/DT>.replace(tzinfo=<tz>) <spanclass="hljs-comment"># Unconverted object with new timezone.</span>
493
493
</code></pre>
494
494
<h3id="encode">Encode</h3>
495
-
<pre><codeclass="python language-python hljs"><D/T/DT> = D/T/DT.fromisoformat(<spanclass="hljs-string">'<iso>'</span>) <spanclass="hljs-comment"># Object from ISO string.</span>
495
+
<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>
496
496
<DT> = DT.strptime(<str>, <spanclass="hljs-string">'<format>'</span>) <spanclass="hljs-comment"># Datetime from str, according to format.</span>
497
497
<D/DTn> = D/DT.fromordinal(<int>) <spanclass="hljs-comment"># D/DTn from days since Christ.</span>
498
498
<DTa> = DT.fromtimestamp(<real>, <tz>) <spanclass="hljs-comment"># DTa from seconds since Epoch in tz time.</span>
@@ -502,7 +502,7 @@ <h3 id="encode">Encode</h3>
502
502
<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>
503
503
</ul>
504
504
<h3id="decode">Decode</h3>
505
-
<pre><codeclass="python language-python hljs"><str> = <D/T/DT>.isoformat() <spanclass="hljs-comment"># ISO string representation.</span>
505
+
<pre><codeclass="python language-python apache hljs"><str> = <D/T/DT>.isoformat() <spanclass="hljs-comment"># ISO string representation.</span>
0 commit comments