Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="datetime-timedelta.html" /> | |
13 | <link rel="prev" href="module-datetime.html" /> | |
14 | <link rel="parent" href="module-datetime.html" /> | |
15 | <link rel="next" href="datetime-timedelta.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>6.10.1 Available Types</title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="6.10 datetime " | |
25 | href="module-datetime.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="6.10 datetime " | |
28 | href="module-datetime.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="6.10.2 timedelta Objects" | |
31 | href="datetime-timedelta.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="module-datetime.html">6.10 datetime </A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="module-datetime.html">6.10 datetime </A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="datetime-timedelta.html">6.10.2 timedelta Objects</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H2><A NAME="SECTION0081010000000000000000"> | |
56 | 6.10.1 Available Types</A> | |
57 | </H2> | |
58 | ||
59 | <P> | |
60 | <dl><dt><b><span class="typelabel">class</span> <tt id='l2h-1858' xml:id='l2h-1858' class="class">date</tt></b> | |
61 | <dd> | |
62 | An idealized naive date, assuming the current Gregorian calendar | |
63 | always was, and always will be, in effect. | |
64 | Attributes: <tt class="member">year</tt>, <tt class="member">month</tt>, and <tt class="member">day</tt>. | |
65 | </dl> | |
66 | ||
67 | <P> | |
68 | <dl><dt><b><span class="typelabel">class</span> <tt id='l2h-1859' xml:id='l2h-1859' class="class">time</tt></b> | |
69 | <dd> | |
70 | An idealized time, independent of any particular day, assuming | |
71 | that every day has exactly 24*60*60 seconds (there is no notion | |
72 | of "leap seconds" here). | |
73 | Attributes: <tt class="member">hour</tt>, <tt class="member">minute</tt>, <tt class="member">second</tt>, | |
74 | <tt class="member">microsecond</tt>, and <tt class="member">tzinfo</tt>. | |
75 | </dl> | |
76 | ||
77 | <P> | |
78 | <dl><dt><b><span class="typelabel">class</span> <tt id='l2h-1860' xml:id='l2h-1860' class="class">datetime</tt></b> | |
79 | <dd> | |
80 | A combination of a date and a time. | |
81 | Attributes: <tt class="member">year</tt>, <tt class="member">month</tt>, <tt class="member">day</tt>, | |
82 | <tt class="member">hour</tt>, <tt class="member">minute</tt>, <tt class="member">second</tt>, | |
83 | <tt class="member">microsecond</tt>, and <tt class="member">tzinfo</tt>. | |
84 | </dl> | |
85 | ||
86 | <P> | |
87 | <dl><dt><b><span class="typelabel">class</span> <tt id='l2h-1861' xml:id='l2h-1861' class="class">timedelta</tt></b> | |
88 | <dd> | |
89 | A duration expressing the difference between two <tt class="class">date</tt>, | |
90 | <tt class="class">time</tt>, or <tt class="class">datetime</tt> instances to microsecond | |
91 | resolution. | |
92 | </dl> | |
93 | ||
94 | <P> | |
95 | <dl><dt><b><span class="typelabel">class</span> <tt id='l2h-1862' xml:id='l2h-1862' class="class">tzinfo</tt></b> | |
96 | <dd> | |
97 | An abstract base class for time zone information objects. These | |
98 | are used by the <tt class="class">datetime</tt> and <tt class="class">time</tt> classes to | |
99 | provide a customizable notion of time adjustment (for example, to | |
100 | account for time zone and/or daylight saving time). | |
101 | </dl> | |
102 | ||
103 | <P> | |
104 | Objects of these types are immutable. | |
105 | ||
106 | <P> | |
107 | Objects of the <tt class="class">date</tt> type are always naive. | |
108 | ||
109 | <P> | |
110 | An object <var>d</var> of type <tt class="class">time</tt> or <tt class="class">datetime</tt> may be | |
111 | naive or aware. <var>d</var> is aware if <code><var>d</var>.tzinfo</code> is not | |
112 | <code>None</code> and <code><var>d</var>.tzinfo.utcoffset(<var>d</var>)</code> does not return | |
113 | <code>None</code>. If <code><var>d</var>.tzinfo</code> is <code>None</code>, or if | |
114 | <code><var>d</var>.tzinfo</code> is not <code>None</code> but | |
115 | <code><var>d</var>.tzinfo.utcoffset(<var>d</var>)</code> returns <code>None</code>, <var>d</var> | |
116 | is naive. | |
117 | ||
118 | <P> | |
119 | The distinction between naive and aware doesn't apply to | |
120 | <tt class="class">timedelta</tt> objects. | |
121 | ||
122 | <P> | |
123 | Subclass relationships: | |
124 | ||
125 | <P> | |
126 | <div class="verbatim"><pre> | |
127 | object | |
128 | timedelta | |
129 | tzinfo | |
130 | time | |
131 | date | |
132 | datetime | |
133 | </pre></div> | |
134 | ||
135 | <P> | |
136 | ||
137 | <DIV CLASS="navigation"> | |
138 | <div class='online-navigation'> | |
139 | <p></p><hr /> | |
140 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
141 | <tr> | |
142 | <td class='online-navigation'><a rel="prev" title="6.10 datetime " | |
143 | href="module-datetime.html"><img src='../icons/previous.png' | |
144 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
145 | <td class='online-navigation'><a rel="parent" title="6.10 datetime " | |
146 | href="module-datetime.html"><img src='../icons/up.png' | |
147 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
148 | <td class='online-navigation'><a rel="next" title="6.10.2 timedelta Objects" | |
149 | href="datetime-timedelta.html"><img src='../icons/next.png' | |
150 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
151 | <td align="center" width="100%">Python Library Reference</td> | |
152 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
153 | href="contents.html"><img src='../icons/contents.png' | |
154 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
155 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
156 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
157 | <td class='online-navigation'><a rel="index" title="Index" | |
158 | href="genindex.html"><img src='../icons/index.png' | |
159 | border='0' height='32' alt='Index' width='32' /></A></td> | |
160 | </tr></table> | |
161 | <div class='online-navigation'> | |
162 | <b class="navlabel">Previous:</b> | |
163 | <a class="sectref" rel="prev" href="module-datetime.html">6.10 datetime </A> | |
164 | <b class="navlabel">Up:</b> | |
165 | <a class="sectref" rel="parent" href="module-datetime.html">6.10 datetime </A> | |
166 | <b class="navlabel">Next:</b> | |
167 | <a class="sectref" rel="next" href="datetime-timedelta.html">6.10.2 timedelta Objects</A> | |
168 | </div> | |
169 | </div> | |
170 | <hr /> | |
171 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
172 | </DIV> | |
173 | <!--End of Navigation Panel--> | |
174 | <ADDRESS> | |
175 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
176 | </ADDRESS> | |
177 | </BODY> | |
178 | </HTML> |