<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>
<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>
<li><strong>If object is naive it is presumed to be in the system's timezone.</strong></li>
<li><strong>If object is naive it is presumed to be in the system's timezone.</strong></li>
</ul><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> datetime <spanclass="hljs-keyword">import</span> date, time, datetime, timedelta
</ul><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> datetime <spanclass="hljs-keyword">import</span> date, time, datetime, timedelta
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'<D/DT>.weekday()'</span></code> to get the day of the week (Mon == 0).</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'<D/DT>.weekday()'</span></code> to get the day of the week (Mon == 0).</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'fold=1'</span></code> means second pass in case of time jumping back for one hour.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'fold=1'</span></code> means second pass in case of time jumping back for one hour.</strong></li>
<li><strong><codeclass="apache hljs"><codeclass="python language-python hljs"><spanclass="hljs-string">'<DT> = resolve_imaginary(<DT>)'</span></code></code> fixes DTs that fall into missing hour.</strong></li>
</ul>
</ul>
<div><h3id="now">Now</h3><pre><codeclass="python language-python hljs"><D/DTn> = D/DT.today() <spanclass="hljs-comment"># Current local date or naive datetime.</span>
<div><h3id="now">Now</h3><pre><codeclass="python language-python hljs"><D/DTn> = D/DT.today() <spanclass="hljs-comment"># Current local date or naive datetime.</span>
<DTn> = DT.utcnow() <spanclass="hljs-comment"># Naive datetime from current UTC time.</span>
<DTn> = DT.utcnow() <spanclass="hljs-comment"># Naive datetime from current UTC time.</span>
@ -701,10 +702,9 @@ shuffle(<list>)
<ul>
<ul>
<li><strong>When parsing, <codeclass="python hljs"><spanclass="hljs-string">'%z'</span></code> also accepts <codeclass="python hljs"><spanclass="hljs-string">'±HH:MM'</span></code>.</strong></li>
<li><strong>When parsing, <codeclass="python hljs"><spanclass="hljs-string">'%z'</span></code> also accepts <codeclass="python hljs"><spanclass="hljs-string">'±HH:MM'</span></code>.</strong></li>
<li><strong>For abbreviated weekday and month use <codeclass="python hljs"><spanclass="hljs-string">'%a'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'%b'</span></code>.</strong></li>