<spanclass="hljs-meta">>>></span>dt.strftime(<spanclass="hljs-string">"%A, %dth of %B '%y, %I:%M%p %Z"</span>)
<spanclass="hljs-string">"Thursday, 14th of May '15, 11:39PM UTC+02:00"</span>
</code></pre></div>
<ul>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'%Z'</span></code> only accepts <codeclass="python hljs"><spanclass="hljs-string">'UTC/GMT'</span></code> and local timezone's code. <codeclass="python hljs"><spanclass="hljs-string">'%z'</span></code> also accepts <codeclass="python hljs"><spanclass="hljs-string">'±HHMM'</span></code>.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'%Z'</span></code> only accepts <codeclass="python hljs"><spanclass="hljs-string">'UTC/GMT'</span></code> and local timezone's code. <codeclass="python hljs"><spanclass="hljs-string">'%z'</span></code> also accepts <codeclass="python hljs"><spanclass="hljs-string">'±02:00'</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>
</ul>
<div><h3id="arithmetics">Arithmetics</h3><pre><codeclass="python language-python apache hljs"><D/DT> = <D/DT> ± <TD><spanclass="hljs-comment"># Returned datetime can fall into missing hour.</span>
@ -1445,7 +1445,7 @@ os.rmdir(<path>) <span class="hljs-comment"># Deletes t
shutil.rmtree(<path>) <spanclass="hljs-comment"># Deletes the directory.</span>
</code></pre>
<div><h3id="shellcommands">Shell Commands</h3><pre><codeclass="python language-python hljs"><pipe> = os.popen(<spanclass="hljs-string">'<command>'</span>) <spanclass="hljs-comment"># Executes command in sh/cmd and returns its stdout pipe.</span>
<str> = <pipe>.read() <spanclass="hljs-comment"># Waits for EOF and returns result. Also readline/s().</span>
<str> = <pipe>.read(size=<spanclass="hljs-number">-1</span>)<spanclass="hljs-comment"># Reads 'size' chars or until EOF. Also readline/s().</span>
<int> = <pipe>.close() <spanclass="hljs-comment"># Closes the pipe. Returns None on success, int on error.</span>