~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-3.5.2-docs-html/c-api/datetime.html

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
 
 
4
 
 
5
<html xmlns="http://www.w3.org/1999/xhtml">
 
6
  <head>
 
7
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
8
    
 
9
    <title>DateTime Objects &mdash; Python 3.5.2 documentation</title>
 
10
    
 
11
    <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
 
12
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
 
13
    
 
14
    <script type="text/javascript">
 
15
      var DOCUMENTATION_OPTIONS = {
 
16
        URL_ROOT:    '../',
 
17
        VERSION:     '3.5.2',
 
18
        COLLAPSE_INDEX: false,
 
19
        FILE_SUFFIX: '.html',
 
20
        HAS_SOURCE:  true
 
21
      };
 
22
    </script>
 
23
    <script type="text/javascript" src="../_static/jquery.js"></script>
 
24
    <script type="text/javascript" src="../_static/underscore.js"></script>
 
25
    <script type="text/javascript" src="../_static/doctools.js"></script>
 
26
    <script type="text/javascript" src="../_static/sidebar.js"></script>
 
27
    <link rel="search" type="application/opensearchdescription+xml"
 
28
          title="Search within Python 3.5.2 documentation"
 
29
          href="../_static/opensearch.xml"/>
 
30
    <link rel="author" title="About these documents" href="../about.html" />
 
31
    <link rel="copyright" title="Copyright" href="../copyright.html" />
 
32
    <link rel="top" title="Python 3.5.2 documentation" href="../contents.html" />
 
33
    <link rel="up" title="Concrete Objects Layer" href="concrete.html" />
 
34
    <link rel="next" title="Initialization, Finalization, and Threads" href="init.html" />
 
35
    <link rel="prev" title="Coroutine Objects" href="coro.html" />
 
36
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 
37
    
 
38
    <script type="text/javascript" src="../_static/copybutton.js"></script>
 
39
    <script type="text/javascript" src="../_static/version_switch.js"></script>
 
40
    
 
41
    
 
42
 
 
43
 
 
44
  </head>
 
45
  <body role="document">  
 
46
    <div class="related" role="navigation" aria-label="related navigation">
 
47
      <h3>Navigation</h3>
 
48
      <ul>
 
49
        <li class="right" style="margin-right: 10px">
 
50
          <a href="../genindex.html" title="General Index"
 
51
             accesskey="I">index</a></li>
 
52
        <li class="right" >
 
53
          <a href="../py-modindex.html" title="Python Module Index"
 
54
             >modules</a> |</li>
 
55
        <li class="right" >
 
56
          <a href="init.html" title="Initialization, Finalization, and Threads"
 
57
             accesskey="N">next</a> |</li>
 
58
        <li class="right" >
 
59
          <a href="coro.html" title="Coroutine Objects"
 
60
             accesskey="P">previous</a> |</li>
 
61
        <li><img src="../_static/py.png" alt=""
 
62
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
63
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
64
        <li>
 
65
          <span class="version_switcher_placeholder">3.5.2</span>
 
66
          <a href="../index.html">Documentation </a> &raquo;
 
67
        </li>
 
68
 
 
69
          <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &raquo;</li>
 
70
          <li class="nav-item nav-item-2"><a href="concrete.html" accesskey="U">Concrete Objects Layer</a> &raquo;</li>
 
71
    <li class="right">
 
72
        
 
73
 
 
74
    <div class="inline-search" style="display: none" role="search">
 
75
        <form class="inline-search" action="../search.html" method="get">
 
76
          <input placeholder="Quick search" type="text" name="q" />
 
77
          <input type="submit" value="Go" />
 
78
          <input type="hidden" name="check_keywords" value="yes" />
 
79
          <input type="hidden" name="area" value="default" />
 
80
        </form>
 
81
    </div>
 
82
    <script type="text/javascript">$('.inline-search').show(0);</script>
 
83
         |
 
84
    </li>
 
85
 
 
86
      </ul>
 
87
    </div>    
 
88
 
 
89
    <div class="document">
 
90
      <div class="documentwrapper">
 
91
        <div class="bodywrapper">
 
92
          <div class="body" role="main">
 
93
            
 
94
  <div class="section" id="datetime-objects">
 
95
<span id="datetimeobjects"></span><h1>DateTime Objects<a class="headerlink" href="#datetime-objects" title="Permalink to this headline">¶</a></h1>
 
96
<p>Various date and time objects are supplied by the <a class="reference internal" href="../library/datetime.html#module-datetime" title="datetime: Basic date and time types."><code class="xref py py-mod docutils literal"><span class="pre">datetime</span></code></a> module.
 
97
Before using any of these functions, the header file <code class="file docutils literal"><span class="pre">datetime.h</span></code> must be
 
98
included in your source (note that this is not included by <code class="file docutils literal"><span class="pre">Python.h</span></code>),
 
99
and the macro <code class="xref c c-macro docutils literal"><span class="pre">PyDateTime_IMPORT</span></code> must be invoked, usually as part of
 
100
the module initialisation function.  The macro puts a pointer to a C structure
 
101
into a static variable, <code class="xref c c-data docutils literal"><span class="pre">PyDateTimeAPI</span></code>, that is used by the following
 
102
macros.</p>
 
103
<p>Type-check macros:</p>
 
104
<dl class="function">
 
105
<dt id="c.PyDate_Check">
 
106
int <code class="descname">PyDate_Check</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDate_Check" title="Permalink to this definition">¶</a></dt>
 
107
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DateType</span></code> or a subtype of
 
108
<code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DateType</span></code>.  <em>ob</em> must not be <em>NULL</em>.</p>
 
109
</dd></dl>
 
110
 
 
111
<dl class="function">
 
112
<dt id="c.PyDate_CheckExact">
 
113
int <code class="descname">PyDate_CheckExact</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDate_CheckExact" title="Permalink to this definition">¶</a></dt>
 
114
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DateType</span></code>. <em>ob</em> must not be
 
115
<em>NULL</em>.</p>
 
116
</dd></dl>
 
117
 
 
118
<dl class="function">
 
119
<dt id="c.PyDateTime_Check">
 
120
int <code class="descname">PyDateTime_Check</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_Check" title="Permalink to this definition">¶</a></dt>
 
121
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DateTimeType</span></code> or a subtype of
 
122
<code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DateTimeType</span></code>.  <em>ob</em> must not be <em>NULL</em>.</p>
 
123
</dd></dl>
 
124
 
 
125
<dl class="function">
 
126
<dt id="c.PyDateTime_CheckExact">
 
127
int <code class="descname">PyDateTime_CheckExact</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_CheckExact" title="Permalink to this definition">¶</a></dt>
 
128
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DateTimeType</span></code>. <em>ob</em> must not
 
129
be <em>NULL</em>.</p>
 
130
</dd></dl>
 
131
 
 
132
<dl class="function">
 
133
<dt id="c.PyTime_Check">
 
134
int <code class="descname">PyTime_Check</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTime_Check" title="Permalink to this definition">¶</a></dt>
 
135
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_TimeType</span></code> or a subtype of
 
136
<code class="xref c c-data docutils literal"><span class="pre">PyDateTime_TimeType</span></code>.  <em>ob</em> must not be <em>NULL</em>.</p>
 
137
</dd></dl>
 
138
 
 
139
<dl class="function">
 
140
<dt id="c.PyTime_CheckExact">
 
141
int <code class="descname">PyTime_CheckExact</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTime_CheckExact" title="Permalink to this definition">¶</a></dt>
 
142
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_TimeType</span></code>. <em>ob</em> must not be
 
143
<em>NULL</em>.</p>
 
144
</dd></dl>
 
145
 
 
146
<dl class="function">
 
147
<dt id="c.PyDelta_Check">
 
148
int <code class="descname">PyDelta_Check</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDelta_Check" title="Permalink to this definition">¶</a></dt>
 
149
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DeltaType</span></code> or a subtype of
 
150
<code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DeltaType</span></code>.  <em>ob</em> must not be <em>NULL</em>.</p>
 
151
</dd></dl>
 
152
 
 
153
<dl class="function">
 
154
<dt id="c.PyDelta_CheckExact">
 
155
int <code class="descname">PyDelta_CheckExact</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDelta_CheckExact" title="Permalink to this definition">¶</a></dt>
 
156
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DeltaType</span></code>. <em>ob</em> must not be
 
157
<em>NULL</em>.</p>
 
158
</dd></dl>
 
159
 
 
160
<dl class="function">
 
161
<dt id="c.PyTZInfo_Check">
 
162
int <code class="descname">PyTZInfo_Check</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTZInfo_Check" title="Permalink to this definition">¶</a></dt>
 
163
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_TZInfoType</span></code> or a subtype of
 
164
<code class="xref c c-data docutils literal"><span class="pre">PyDateTime_TZInfoType</span></code>.  <em>ob</em> must not be <em>NULL</em>.</p>
 
165
</dd></dl>
 
166
 
 
167
<dl class="function">
 
168
<dt id="c.PyTZInfo_CheckExact">
 
169
int <code class="descname">PyTZInfo_CheckExact</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*ob</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTZInfo_CheckExact" title="Permalink to this definition">¶</a></dt>
 
170
<dd><p>Return true if <em>ob</em> is of type <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_TZInfoType</span></code>. <em>ob</em> must not be
 
171
<em>NULL</em>.</p>
 
172
</dd></dl>
 
173
 
 
174
<p>Macros to create objects:</p>
 
175
<dl class="function">
 
176
<dt id="c.PyDate_FromDate">
 
177
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDate_FromDate</code><span class="sig-paren">(</span>int<em>&nbsp;year</em>, int<em>&nbsp;month</em>, int<em>&nbsp;day</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDate_FromDate" title="Permalink to this definition">¶</a></dt>
 
178
<dd><em class="refcount">Return value: New reference.</em><p>Return a <code class="docutils literal"><span class="pre">datetime.date</span></code> object with the specified year, month and day.</p>
 
179
</dd></dl>
 
180
 
 
181
<dl class="function">
 
182
<dt id="c.PyDateTime_FromDateAndTime">
 
183
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDateTime_FromDateAndTime</code><span class="sig-paren">(</span>int<em>&nbsp;year</em>, int<em>&nbsp;month</em>, int<em>&nbsp;day</em>, int<em>&nbsp;hour</em>, int<em>&nbsp;minute</em>, int<em>&nbsp;second</em>, int<em>&nbsp;usecond</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_FromDateAndTime" title="Permalink to this definition">¶</a></dt>
 
184
<dd><em class="refcount">Return value: New reference.</em><p>Return a <code class="docutils literal"><span class="pre">datetime.datetime</span></code> object with the specified year, month, day, hour,
 
185
minute, second and microsecond.</p>
 
186
</dd></dl>
 
187
 
 
188
<dl class="function">
 
189
<dt id="c.PyTime_FromTime">
 
190
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyTime_FromTime</code><span class="sig-paren">(</span>int<em>&nbsp;hour</em>, int<em>&nbsp;minute</em>, int<em>&nbsp;second</em>, int<em>&nbsp;usecond</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTime_FromTime" title="Permalink to this definition">¶</a></dt>
 
191
<dd><em class="refcount">Return value: New reference.</em><p>Return a <code class="docutils literal"><span class="pre">datetime.time</span></code> object with the specified hour, minute, second and
 
192
microsecond.</p>
 
193
</dd></dl>
 
194
 
 
195
<dl class="function">
 
196
<dt id="c.PyDelta_FromDSU">
 
197
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDelta_FromDSU</code><span class="sig-paren">(</span>int<em>&nbsp;days</em>, int<em>&nbsp;seconds</em>, int<em>&nbsp;useconds</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDelta_FromDSU" title="Permalink to this definition">¶</a></dt>
 
198
<dd><em class="refcount">Return value: New reference.</em><p>Return a <code class="docutils literal"><span class="pre">datetime.timedelta</span></code> object representing the given number of days,
 
199
seconds and microseconds.  Normalization is performed so that the resulting
 
200
number of microseconds and seconds lie in the ranges documented for
 
201
<code class="docutils literal"><span class="pre">datetime.timedelta</span></code> objects.</p>
 
202
</dd></dl>
 
203
 
 
204
<p>Macros to extract fields from date objects.  The argument must be an instance of
 
205
<code class="xref c c-data docutils literal"><span class="pre">PyDateTime_Date</span></code>, including subclasses (such as
 
206
<code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DateTime</span></code>).  The argument must not be <em>NULL</em>, and the type is
 
207
not checked:</p>
 
208
<dl class="function">
 
209
<dt id="c.PyDateTime_GET_YEAR">
 
210
int <code class="descname">PyDateTime_GET_YEAR</code><span class="sig-paren">(</span>PyDateTime_Date<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_GET_YEAR" title="Permalink to this definition">¶</a></dt>
 
211
<dd><p>Return the year, as a positive int.</p>
 
212
</dd></dl>
 
213
 
 
214
<dl class="function">
 
215
<dt id="c.PyDateTime_GET_MONTH">
 
216
int <code class="descname">PyDateTime_GET_MONTH</code><span class="sig-paren">(</span>PyDateTime_Date<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_GET_MONTH" title="Permalink to this definition">¶</a></dt>
 
217
<dd><p>Return the month, as an int from 1 through 12.</p>
 
218
</dd></dl>
 
219
 
 
220
<dl class="function">
 
221
<dt id="c.PyDateTime_GET_DAY">
 
222
int <code class="descname">PyDateTime_GET_DAY</code><span class="sig-paren">(</span>PyDateTime_Date<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_GET_DAY" title="Permalink to this definition">¶</a></dt>
 
223
<dd><p>Return the day, as an int from 1 through 31.</p>
 
224
</dd></dl>
 
225
 
 
226
<p>Macros to extract fields from datetime objects.  The argument must be an
 
227
instance of <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_DateTime</span></code>, including subclasses. The argument
 
228
must not be <em>NULL</em>, and the type is not checked:</p>
 
229
<dl class="function">
 
230
<dt id="c.PyDateTime_DATE_GET_HOUR">
 
231
int <code class="descname">PyDateTime_DATE_GET_HOUR</code><span class="sig-paren">(</span>PyDateTime_DateTime<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_DATE_GET_HOUR" title="Permalink to this definition">¶</a></dt>
 
232
<dd><p>Return the hour, as an int from 0 through 23.</p>
 
233
</dd></dl>
 
234
 
 
235
<dl class="function">
 
236
<dt id="c.PyDateTime_DATE_GET_MINUTE">
 
237
int <code class="descname">PyDateTime_DATE_GET_MINUTE</code><span class="sig-paren">(</span>PyDateTime_DateTime<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_DATE_GET_MINUTE" title="Permalink to this definition">¶</a></dt>
 
238
<dd><p>Return the minute, as an int from 0 through 59.</p>
 
239
</dd></dl>
 
240
 
 
241
<dl class="function">
 
242
<dt id="c.PyDateTime_DATE_GET_SECOND">
 
243
int <code class="descname">PyDateTime_DATE_GET_SECOND</code><span class="sig-paren">(</span>PyDateTime_DateTime<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_DATE_GET_SECOND" title="Permalink to this definition">¶</a></dt>
 
244
<dd><p>Return the second, as an int from 0 through 59.</p>
 
245
</dd></dl>
 
246
 
 
247
<dl class="function">
 
248
<dt id="c.PyDateTime_DATE_GET_MICROSECOND">
 
249
int <code class="descname">PyDateTime_DATE_GET_MICROSECOND</code><span class="sig-paren">(</span>PyDateTime_DateTime<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_DATE_GET_MICROSECOND" title="Permalink to this definition">¶</a></dt>
 
250
<dd><p>Return the microsecond, as an int from 0 through 999999.</p>
 
251
</dd></dl>
 
252
 
 
253
<p>Macros to extract fields from time objects.  The argument must be an instance of
 
254
<code class="xref c c-data docutils literal"><span class="pre">PyDateTime_Time</span></code>, including subclasses. The argument must not be <em>NULL</em>,
 
255
and the type is not checked:</p>
 
256
<dl class="function">
 
257
<dt id="c.PyDateTime_TIME_GET_HOUR">
 
258
int <code class="descname">PyDateTime_TIME_GET_HOUR</code><span class="sig-paren">(</span>PyDateTime_Time<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_TIME_GET_HOUR" title="Permalink to this definition">¶</a></dt>
 
259
<dd><p>Return the hour, as an int from 0 through 23.</p>
 
260
</dd></dl>
 
261
 
 
262
<dl class="function">
 
263
<dt id="c.PyDateTime_TIME_GET_MINUTE">
 
264
int <code class="descname">PyDateTime_TIME_GET_MINUTE</code><span class="sig-paren">(</span>PyDateTime_Time<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_TIME_GET_MINUTE" title="Permalink to this definition">¶</a></dt>
 
265
<dd><p>Return the minute, as an int from 0 through 59.</p>
 
266
</dd></dl>
 
267
 
 
268
<dl class="function">
 
269
<dt id="c.PyDateTime_TIME_GET_SECOND">
 
270
int <code class="descname">PyDateTime_TIME_GET_SECOND</code><span class="sig-paren">(</span>PyDateTime_Time<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_TIME_GET_SECOND" title="Permalink to this definition">¶</a></dt>
 
271
<dd><p>Return the second, as an int from 0 through 59.</p>
 
272
</dd></dl>
 
273
 
 
274
<dl class="function">
 
275
<dt id="c.PyDateTime_TIME_GET_MICROSECOND">
 
276
int <code class="descname">PyDateTime_TIME_GET_MICROSECOND</code><span class="sig-paren">(</span>PyDateTime_Time<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_TIME_GET_MICROSECOND" title="Permalink to this definition">¶</a></dt>
 
277
<dd><p>Return the microsecond, as an int from 0 through 999999.</p>
 
278
</dd></dl>
 
279
 
 
280
<p>Macros to extract fields from time delta objects.  The argument must be an
 
281
instance of <code class="xref c c-data docutils literal"><span class="pre">PyDateTime_Delta</span></code>, including subclasses. The argument must
 
282
not be <em>NULL</em>, and the type is not checked:</p>
 
283
<dl class="function">
 
284
<dt id="c.PyDateTime_DELTA_GET_DAYS">
 
285
int <code class="descname">PyDateTime_DELTA_GET_DAYS</code><span class="sig-paren">(</span>PyDateTime_Delta<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_DELTA_GET_DAYS" title="Permalink to this definition">¶</a></dt>
 
286
<dd><p>Return the number of days, as an int from -999999999 to 999999999.</p>
 
287
<div class="versionadded">
 
288
<p><span class="versionmodified">New in version 3.3.</span></p>
 
289
</div>
 
290
</dd></dl>
 
291
 
 
292
<dl class="function">
 
293
<dt id="c.PyDateTime_DELTA_GET_SECONDS">
 
294
int <code class="descname">PyDateTime_DELTA_GET_SECONDS</code><span class="sig-paren">(</span>PyDateTime_Delta<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_DELTA_GET_SECONDS" title="Permalink to this definition">¶</a></dt>
 
295
<dd><p>Return the number of seconds, as an int from 0 through 86399.</p>
 
296
<div class="versionadded">
 
297
<p><span class="versionmodified">New in version 3.3.</span></p>
 
298
</div>
 
299
</dd></dl>
 
300
 
 
301
<dl class="function">
 
302
<dt id="c.PyDateTime_DELTA_GET_MICROSECOND">
 
303
int <code class="descname">PyDateTime_DELTA_GET_MICROSECOND</code><span class="sig-paren">(</span>PyDateTime_Delta<em>&nbsp;*o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_DELTA_GET_MICROSECOND" title="Permalink to this definition">¶</a></dt>
 
304
<dd><p>Return the number of microseconds, as an int from 0 through 999999.</p>
 
305
<div class="versionadded">
 
306
<p><span class="versionmodified">New in version 3.3.</span></p>
 
307
</div>
 
308
</dd></dl>
 
309
 
 
310
<p>Macros for the convenience of modules implementing the DB API:</p>
 
311
<dl class="function">
 
312
<dt id="c.PyDateTime_FromTimestamp">
 
313
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDateTime_FromTimestamp</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*args</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDateTime_FromTimestamp" title="Permalink to this definition">¶</a></dt>
 
314
<dd><em class="refcount">Return value: New reference.</em><p>Create and return a new <code class="docutils literal"><span class="pre">datetime.datetime</span></code> object given an argument tuple
 
315
suitable for passing to <code class="docutils literal"><span class="pre">datetime.datetime.fromtimestamp()</span></code>.</p>
 
316
</dd></dl>
 
317
 
 
318
<dl class="function">
 
319
<dt id="c.PyDate_FromTimestamp">
 
320
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDate_FromTimestamp</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*args</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDate_FromTimestamp" title="Permalink to this definition">¶</a></dt>
 
321
<dd><em class="refcount">Return value: New reference.</em><p>Create and return a new <code class="docutils literal"><span class="pre">datetime.date</span></code> object given an argument tuple
 
322
suitable for passing to <code class="docutils literal"><span class="pre">datetime.date.fromtimestamp()</span></code>.</p>
 
323
</dd></dl>
 
324
 
 
325
</div>
 
326
 
 
327
 
 
328
          </div>
 
329
        </div>
 
330
      </div>
 
331
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
 
332
        <div class="sphinxsidebarwrapper">
 
333
  <h4>Previous topic</h4>
 
334
  <p class="topless"><a href="coro.html"
 
335
                        title="previous chapter">Coroutine Objects</a></p>
 
336
  <h4>Next topic</h4>
 
337
  <p class="topless"><a href="init.html"
 
338
                        title="next chapter">Initialization, Finalization, and Threads</a></p>
 
339
  <div role="note" aria-label="source link">
 
340
    <h3>This Page</h3>
 
341
    <ul class="this-page-menu">
 
342
      <li><a href="../bugs.html">Report a Bug</a></li>
 
343
      <li><a href="../_sources/c-api/datetime.txt"
 
344
            rel="nofollow">Show Source</a></li>
 
345
    </ul>
 
346
  </div>
 
347
        </div>
 
348
      </div>
 
349
      <div class="clearer"></div>
 
350
    </div>  
 
351
    <div class="related" role="navigation" aria-label="related navigation">
 
352
      <h3>Navigation</h3>
 
353
      <ul>
 
354
        <li class="right" style="margin-right: 10px">
 
355
          <a href="../genindex.html" title="General Index"
 
356
             >index</a></li>
 
357
        <li class="right" >
 
358
          <a href="../py-modindex.html" title="Python Module Index"
 
359
             >modules</a> |</li>
 
360
        <li class="right" >
 
361
          <a href="init.html" title="Initialization, Finalization, and Threads"
 
362
             >next</a> |</li>
 
363
        <li class="right" >
 
364
          <a href="coro.html" title="Coroutine Objects"
 
365
             >previous</a> |</li>
 
366
        <li><img src="../_static/py.png" alt=""
 
367
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
368
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
369
        <li>
 
370
          <span class="version_switcher_placeholder">3.5.2</span>
 
371
          <a href="../index.html">Documentation </a> &raquo;
 
372
        </li>
 
373
 
 
374
          <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &raquo;</li>
 
375
          <li class="nav-item nav-item-2"><a href="concrete.html" >Concrete Objects Layer</a> &raquo;</li>
 
376
    <li class="right">
 
377
        
 
378
 
 
379
    <div class="inline-search" style="display: none" role="search">
 
380
        <form class="inline-search" action="../search.html" method="get">
 
381
          <input placeholder="Quick search" type="text" name="q" />
 
382
          <input type="submit" value="Go" />
 
383
          <input type="hidden" name="check_keywords" value="yes" />
 
384
          <input type="hidden" name="area" value="default" />
 
385
        </form>
 
386
    </div>
 
387
    <script type="text/javascript">$('.inline-search').show(0);</script>
 
388
         |
 
389
    </li>
 
390
 
 
391
      </ul>
 
392
    </div>  
 
393
    <div class="footer">
 
394
    &copy; <a href="../copyright.html">Copyright</a> 2001-2016, Python Software Foundation.
 
395
    <br />
 
396
    The Python Software Foundation is a non-profit corporation.
 
397
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
 
398
    <br />
 
399
    Last updated on Sep 23, 2016.
 
400
    <a href="../bugs.html">Found a bug</a>?
 
401
    <br />
 
402
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
 
403
    </div>
 
404
 
 
405
  </body>
 
406
</html>
 
 
b'\\ No newline at end of file'