⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module-rfc822.html

📁 一本很好的python的说明书,适合对python感兴趣的人
💻 HTML
📖 第 1 页 / 共 2 页
字号:
  border='0' class='offsitelink' height='15' width='17' alt='[off-site link]'
  ></a> addresses to be
parsed.  (The parameter <code>None</code> yields an empty list.)
</dl>

<P>
<dl><dt><b><a name='l2h-2348'><tt class='function'>parsedate</tt></a></b> (<var>date</var>)
<dd>
Attempts to parse a date according to the rules in <a class="rfc" name="rfcref-47405"
href="javascript:if(confirm('http://www.ietf.org/rfc/rfc0822.txt  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.ietf.org/rfc/rfc0822.txt'" tppabs="http://www.ietf.org/rfc/rfc0822.txt">RFC 822 <img src="offsite.gif" tppabs="http://www.python.org/doc/current/icons/offsite.gif"
  border='0' class='offsitelink' height='15' width='17' alt='[off-site link]'
  ></a>.
however, some mailers don't follow that format as specified, so
<tt class="function">parsedate()</tt> tries to guess correctly in such cases. 
<var>date</var> is a string containing an <a class="rfc" name="rfcref-47407"
href="javascript:if(confirm('http://www.ietf.org/rfc/rfc0822.txt  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.ietf.org/rfc/rfc0822.txt'" tppabs="http://www.ietf.org/rfc/rfc0822.txt">RFC 822 <img src="offsite.gif" tppabs="http://www.python.org/doc/current/icons/offsite.gif"
  border='0' class='offsitelink' height='15' width='17' alt='[off-site link]'
  ></a> date, such as 
<code>'Mon, 20 Nov 1995 19:12:08 -0500'</code>.  If it succeeds in parsing
the date, <tt class="function">parsedate()</tt> returns a 9-tuple that can be passed
directly to <tt class="function">time.mktime()</tt>; otherwise <code>None</code> will be
returned.  Note that fields 6, 7, and 8 of the result tuple are not
usable.
</dl>

<P>
<dl><dt><b><a name='l2h-2349'><tt class='function'>parsedate_tz</tt></a></b> (<var>date</var>)
<dd>
Performs the same function as <tt class="function">parsedate()</tt>, but returns
either <code>None</code> or a 10-tuple; the first 9 elements make up a tuple
that can be passed directly to <tt class="function">time.mktime()</tt>, and the tenth
is the offset of the date's timezone from UTC (which is the official
term for Greenwich Mean Time).  (Note that the sign of the timezone
offset is the opposite of the sign of the <code>time.timezone</code>
variable for the same timezone; the latter variable follows the
POSIX standard while this module follows <a class="rfc" name="rfcref-47409"
href="javascript:if(confirm('http://www.ietf.org/rfc/rfc0822.txt  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.ietf.org/rfc/rfc0822.txt'" tppabs="http://www.ietf.org/rfc/rfc0822.txt">RFC 822 <img src="offsite.gif" tppabs="http://www.python.org/doc/current/icons/offsite.gif"
  border='0' class='offsitelink' height='15' width='17' alt='[off-site link]'
  ></a>.)  If the input
string has no timezone, the last element of the tuple returned is
<code>None</code>.  Note that fields 6, 7, and 8 of the result tuple are not
usable.
</dl>

<P>
<dl><dt><b><a name='l2h-2350'><tt class='function'>mktime_tz</tt></a></b> (<var>tuple</var>)
<dd>
Turn a 10-tuple as returned by <tt class="function">parsedate_tz()</tt> into a UTC
timestamp.  It the timezone item in the tuple is <code>None</code>, assume
local time.  Minor deficiency: this first interprets the first 8
elements as a local time and then compensates for the timezone
difference; this may yield a slight error around daylight savings time
switch dates.  Not enough to worry about for common use.
</dl>

<P>
<div class='seealso'>
  <p class='heading'><b>See Also:</b></p>

  <dl compact class="seemodule">
    <dt>Module <b><tt class='module'><a href="module-mailbox.html" tppabs="http://www.python.org/doc/current/lib/module-mailbox.html">mailbox</a></tt>:</b>
    <dd>Classes to read various mailbox formats produced 
                      by end-user mail programs.
  </dl>
  <dl compact class="seemodule">
    <dt>Module <b><tt class='module'><a href="module-mimetools.html" tppabs="http://www.python.org/doc/current/lib/module-mimetools.html">mimetools</a></tt>:</b>
    <dd>Subclass of rfc.Message that handles MIME encoded
		        messages.
  </dl> 
</div>

<P>

<p><hr>
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html4386"
  href="message-objects.html" tppabs="http://www.python.org/doc/current/lib/message-objects.html">12.2.1 Message Objects </A>
<LI><A NAME="tex2html4387"
  href="addresslist-objects.html" tppabs="http://www.python.org/doc/current/lib/addresslist-objects.html">12.2.2 AddressList Objects </A>
</UL>
<!--End of Table of Child-Links-->

<DIV CLASS="navigation"><p><hr><table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="writer-impls.html" tppabs="http://www.python.org/doc/current/lib/writer-impls.html"><img src="previous.gif" tppabs="http://www.python.org/doc/current/icons/previous.gif" border="0" height="32"
  alt="Previous Page" width="32"></A></td>
<td><A href="netdata.html" tppabs="http://www.python.org/doc/current/lib/netdata.html"><img src="up.gif" tppabs="http://www.python.org/doc/current/icons/up.gif" border="0" height="32"
  alt="Up One Level" width="32"></A></td>
<td><A href="message-objects.html" tppabs="http://www.python.org/doc/current/lib/message-objects.html"><img src="next.gif" tppabs="http://www.python.org/doc/current/icons/next.gif" border="0" height="32"
  alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td><A href="contents.html" tppabs="http://www.python.org/doc/current/lib/contents.html"><img src="contents.gif" tppabs="http://www.python.org/doc/current/icons/contents.gif" border="0" height="32"
  alt="Contents" width="32"></A></td>
<td><a href="modindex.html" tppabs="http://www.python.org/doc/current/lib/modindex.html" title="Module Index"><img src="modules.gif" tppabs="http://www.python.org/doc/current/icons/modules.gif" border="0" height="32"
  alt="Module Index" width="32"></a></td>
<td><A href="genindex.html" tppabs="http://www.python.org/doc/current/lib/genindex.html"><img src="index.gif" tppabs="http://www.python.org/doc/current/icons/index.gif" border="0" height="32"
  alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="writer-impls.html" tppabs="http://www.python.org/doc/current/lib/writer-impls.html">12.1.4 Writer Implementations</A>
<b class="navlabel">Up:</b> <a class="sectref" href="netdata.html" tppabs="http://www.python.org/doc/current/lib/netdata.html">12. Internet Data Handling</A>
<b class="navlabel">Next:</b> <a class="sectref" href="message-objects.html" tppabs="http://www.python.org/doc/current/lib/message-objects.html">12.2.1 Message Objects</A>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
<hr>See <i><a href="about.html" tppabs="http://www.python.org/doc/current/lib/about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -