source: TI03-DataExtractor/branches/old_stuff/dx_source/for_usr_local/dx/doc/times.html @ 793

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/branches/old_stuff/dx_source/for_usr_local/dx/doc/times.html@793
Revision 793, 14.0 KB checked in by astephen, 13 years ago (diff)

Put all the old code in the old_stuff branch.

Line 
1
2<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3<html><head><title>Python: module times</title>
4</head><body bgcolor="#f0f0f8">
5
6<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
7<tr bgcolor="#7799ee">
8<td valign=bottom>&nbsp;<br>
9<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>times</strong></big></big></font></td
10><td align=right valign=bottom
11><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/dx-0.1.1/times.py">/usr/local/dx-0.1.1/times.py</a></font></td></tr></table>
12    <p><tt>#&nbsp;&nbsp;&nbsp;Copyright&nbsp;(C)&nbsp;2004&nbsp;CCLRC&nbsp;&amp;&nbsp;NERC(&nbsp;Natural&nbsp;Environment&nbsp;Research&nbsp;Council&nbsp;).<br>
13#&nbsp;&nbsp;&nbsp;This&nbsp;software&nbsp;may&nbsp;be&nbsp;distributed&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the<br>
14#&nbsp;&nbsp;&nbsp;Q&nbsp;Public&nbsp;License,&nbsp;version&nbsp;1.0&nbsp;or&nbsp;later.&nbsp;<a href="http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt">http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt</a></tt></p>
15<p>
16<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
17<tr bgcolor="#aa55cc">
18<td colspan=3 valign=bottom>&nbsp;<br>
19<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
20   
21<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
22<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="re.html">re</a><br>
23</td><td width="25%" valign=top><a href="time.html">time</a><br>
24</td><td width="25%" valign=top><a href="types.html">types</a><br>
25</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
26<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
27<tr bgcolor="#ee77aa">
28<td colspan=3 valign=bottom>&nbsp;<br>
29<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
30   
31<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
32<td width="100%"><dl>
33<dt><font face="helvetica, arial"><a href="times.html#DateTime">DateTime</a>
34</font></dt><dd>
35<dl>
36<dt><font face="helvetica, arial"><a href="times.html#UMTime">UMTime</a>
37</font></dt></dl>
38</dd>
39</dl>
40 <p>
41<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
42<tr bgcolor="#ffc8d8">
43<td colspan=3 valign=bottom>&nbsp;<br>
44<font color="#000000" face="helvetica, arial"><a name="DateTime">class <strong>DateTime</strong></a></font></td></tr>
45   
46<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
47<td colspan=2><tt>Class&nbsp;to&nbsp;return&nbsp;lists&nbsp;of&nbsp;dates&nbsp;and&nbsp;times&nbsp;and&nbsp;allow&nbsp;adding&nbsp;and<br>
48subtracting&nbsp;of&nbsp;time&nbsp;intervals&nbsp;from&nbsp;time&nbsp;objects.<br>&nbsp;</tt></td></tr>
49<tr><td>&nbsp;</td>
50<td width="100%">Methods defined here:<br>
51<dl><dt><a name="DateTime-__getattr__"><strong>__getattr__</strong></a>(self, att)</dt><dd><tt>##########################################<br>
52#<br>
53#&nbsp;<a href="#DateTime-__getattr__">__getattr__</a>()&nbsp;method<br>
54#<br>
55##########################################</tt></dd></dl>
56
57<dl><dt><a name="DateTime-__init__"><strong>__init__</strong></a>(self, year<font color="#909090">=0</font>, month<font color="#909090">=1</font>, day<font color="#909090">=1</font>, hour<font color="#909090">=0</font>, minute<font color="#909090">=0</font>, second<font color="#909090">=0</font>)</dt><dd><tt>Method&nbsp;to&nbsp;set&nbsp;up&nbsp;the&nbsp;instance&nbsp;formats&nbsp;and&nbsp;basic&nbsp;objects.</tt></dd></dl>
58
59<dl><dt><a name="DateTime-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>##########################################<br>
60#<br>
61#&nbsp;<a href="#DateTime-__repr__">__repr__</a>()&nbsp;method<br>
62#<br>
63##########################################</tt></dd></dl>
64
65<dl><dt><a name="DateTime-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>##########################################<br>
66#<br>
67#&nbsp;<a href="#DateTime-__str__">__str__</a>()&nbsp;method<br>
68#<br>
69##########################################</tt></dd></dl>
70
71<dl><dt><a name="DateTime-add"><strong>add</strong></a>(self, n, unit<font color="#909090">='hour'</font>)</dt><dd><tt>##########################################<br>
72#<br>
73#&nbsp;<a href="#DateTime-add">add</a>()&nbsp;method<br>
74#<br>
75##########################################</tt></dd></dl>
76
77<dl><dt><a name="DateTime-createList"><strong>createList</strong></a>(self, start, end, interval<font color="#909090">=(6, 'hour')</font>, listtype<font color="#909090">='string'</font>, formatstring<font color="#909090">='%Y-%m-%d %H:%M:%S'</font>)</dt><dd><tt>##########################################<br>
78#<br>
79#&nbsp;<a href="#DateTime-createList">createList</a>()&nbsp;method<br>
80#<br>
81##########################################</tt></dd></dl>
82
83<dl><dt><a name="DateTime-formatTime"><strong>formatTime</strong></a>(self, formatstring<font color="#909090">='%Y-%m-%d %H:%M:%S'</font>, itime<font color="#909090">=None</font>)</dt><dd><tt>##########################################<br>
84#<br>
85#&nbsp;<a href="#DateTime-formatTime">formatTime</a>()&nbsp;method<br>
86#<br>
87##########################################</tt></dd></dl>
88
89<dl><dt><a name="DateTime-getDaysInMonth"><strong>getDaysInMonth</strong></a>(self, month, year)</dt><dd><tt>##########################################<br>
90#<br>
91#&nbsp;<a href="#DateTime-getDaysInMonth">getDaysInMonth</a>()&nbsp;method<br>
92#<br>
93##########################################</tt></dd></dl>
94
95<dl><dt><a name="DateTime-getTimeBins"><strong>getTimeBins</strong></a>(self, timelist)</dt><dd><tt>Method&nbsp;to&nbsp;collect&nbsp;all&nbsp;available&nbsp;values&nbsp;of&nbsp;year,&nbsp;month,&nbsp;day&nbsp;etc&nbsp;into&nbsp;individual&nbsp;<br>
96lists&nbsp;for&nbsp;populating&nbsp;selection&nbsp;boxes.</tt></dd></dl>
97
98<dl><dt><a name="DateTime-printtime"><strong>printtime</strong></a>(self, formatstring<font color="#909090">='%Y-%m-%d %H:%M:%S'</font>, itime<font color="#909090">=None</font>)</dt><dd><tt>##########################################<br>
99#<br>
100#&nbsp;<a href="#DateTime-printtime">printtime</a>()&nbsp;method<br>
101#<br>
102##########################################</tt></dd></dl>
103
104<dl><dt><a name="DateTime-sub"><strong>sub</strong></a>(self, n, unit<font color="#909090">='hour'</font>)</dt><dd><tt>##########################################<br>
105#<br>
106#&nbsp;<a href="#DateTime-sub">sub</a>()&nbsp;method<br>
107#<br>
108##########################################</tt></dd></dl>
109
110<hr>
111Data and other attributes defined here:<br>
112<dl><dt><strong>max</strong> = [99999, 13, None, 24, 60, 60]</dl>
113
114<dl><dt><strong>min</strong> = [0, 1, 1, 0, 0, 0]</dl>
115
116<dl><dt><strong>positions</strong> = ['year', 'month', 'day', 'hour', 'minute', 'second']</dl>
117
118<dl><dt><strong>units</strong> = {'day': 'd ds dy dys day days', 'hour': 'h hs hr hrs hour hours', 'minute': 'min mins minute minutes', 'month': 'mon mons mnth mnths month months', 'second': 's sc scs sec secs scnd scnds second seconds', 'year': 'y ys yr yrs year years'}</dl>
119
120</td></tr></table> <p>
121<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
122<tr bgcolor="#ffc8d8">
123<td colspan=3 valign=bottom>&nbsp;<br>
124<font color="#000000" face="helvetica, arial"><a name="UMTime">class <strong>UMTime</strong></a>(<a href="times.html#DateTime">DateTime</a>)</font></td></tr>
125   
126<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
127<td colspan=2><tt>##############################################<br>
128#<br>
129#&nbsp;class&nbsp;<a href="#UMTime">UMTime</a><br>
130#<br>
131##############################################<br>&nbsp;</tt></td></tr>
132<tr><td>&nbsp;</td>
133<td width="100%">Methods defined here:<br>
134<dl><dt><a name="UMTime-__init__"><strong>__init__</strong></a>(self, year<font color="#909090">=0</font>, month<font color="#909090">=1</font>, day<font color="#909090">=1</font>, hour<font color="#909090">=0</font>, minute<font color="#909090">=0</font>, second<font color="#909090">=0</font>)</dt><dd><tt>##########################################<br>
135#<br>
136#&nbsp;<a href="#UMTime-__init__">__init__</a>()&nbsp;method<br>
137#<br>
138##########################################</tt></dd></dl>
139
140<dl><dt><a name="UMTime-getUMYear"><strong>getUMYear</strong></a>(self, itime)</dt><dd><tt>##########################################<br>
141#<br>
142#&nbsp;<a href="#UMTime-getUMYear">getUMYear</a>()&nbsp;method<br>
143#<br>
144##########################################</tt></dd></dl>
145
146<hr>
147Methods inherited from <a href="times.html#DateTime">DateTime</a>:<br>
148<dl><dt><a name="UMTime-__getattr__"><strong>__getattr__</strong></a>(self, att)</dt><dd><tt>##########################################<br>
149#<br>
150#&nbsp;<a href="#UMTime-__getattr__">__getattr__</a>()&nbsp;method<br>
151#<br>
152##########################################</tt></dd></dl>
153
154<dl><dt><a name="UMTime-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>##########################################<br>
155#<br>
156#&nbsp;<a href="#UMTime-__repr__">__repr__</a>()&nbsp;method<br>
157#<br>
158##########################################</tt></dd></dl>
159
160<dl><dt><a name="UMTime-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>##########################################<br>
161#<br>
162#&nbsp;<a href="#UMTime-__str__">__str__</a>()&nbsp;method<br>
163#<br>
164##########################################</tt></dd></dl>
165
166<dl><dt><a name="UMTime-add"><strong>add</strong></a>(self, n, unit<font color="#909090">='hour'</font>)</dt><dd><tt>##########################################<br>
167#<br>
168#&nbsp;<a href="#UMTime-add">add</a>()&nbsp;method<br>
169#<br>
170##########################################</tt></dd></dl>
171
172<dl><dt><a name="UMTime-createList"><strong>createList</strong></a>(self, start, end, interval<font color="#909090">=(6, 'hour')</font>, listtype<font color="#909090">='string'</font>, formatstring<font color="#909090">='%Y-%m-%d %H:%M:%S'</font>)</dt><dd><tt>##########################################<br>
173#<br>
174#&nbsp;<a href="#UMTime-createList">createList</a>()&nbsp;method<br>
175#<br>
176##########################################</tt></dd></dl>
177
178<dl><dt><a name="UMTime-formatTime"><strong>formatTime</strong></a>(self, formatstring<font color="#909090">='%Y-%m-%d %H:%M:%S'</font>, itime<font color="#909090">=None</font>)</dt><dd><tt>##########################################<br>
179#<br>
180#&nbsp;<a href="#UMTime-formatTime">formatTime</a>()&nbsp;method<br>
181#<br>
182##########################################</tt></dd></dl>
183
184<dl><dt><a name="UMTime-getDaysInMonth"><strong>getDaysInMonth</strong></a>(self, month, year)</dt><dd><tt>##########################################<br>
185#<br>
186#&nbsp;<a href="#UMTime-getDaysInMonth">getDaysInMonth</a>()&nbsp;method<br>
187#<br>
188##########################################</tt></dd></dl>
189
190<dl><dt><a name="UMTime-getTimeBins"><strong>getTimeBins</strong></a>(self, timelist)</dt><dd><tt>Method&nbsp;to&nbsp;collect&nbsp;all&nbsp;available&nbsp;values&nbsp;of&nbsp;year,&nbsp;month,&nbsp;day&nbsp;etc&nbsp;into&nbsp;individual&nbsp;<br>
191lists&nbsp;for&nbsp;populating&nbsp;selection&nbsp;boxes.</tt></dd></dl>
192
193<dl><dt><a name="UMTime-printtime"><strong>printtime</strong></a>(self, formatstring<font color="#909090">='%Y-%m-%d %H:%M:%S'</font>, itime<font color="#909090">=None</font>)</dt><dd><tt>##########################################<br>
194#<br>
195#&nbsp;<a href="#UMTime-printtime">printtime</a>()&nbsp;method<br>
196#<br>
197##########################################</tt></dd></dl>
198
199<dl><dt><a name="UMTime-sub"><strong>sub</strong></a>(self, n, unit<font color="#909090">='hour'</font>)</dt><dd><tt>##########################################<br>
200#<br>
201#&nbsp;<a href="#UMTime-sub">sub</a>()&nbsp;method<br>
202#<br>
203##########################################</tt></dd></dl>
204
205<hr>
206Data and other attributes inherited from <a href="times.html#DateTime">DateTime</a>:<br>
207<dl><dt><strong>max</strong> = [99999, 13, None, 24, 60, 60]</dl>
208
209<dl><dt><strong>min</strong> = [0, 1, 1, 0, 0, 0]</dl>
210
211<dl><dt><strong>positions</strong> = ['year', 'month', 'day', 'hour', 'minute', 'second']</dl>
212
213<dl><dt><strong>units</strong> = {'day': 'd ds dy dys day days', 'hour': 'h hs hr hrs hour hours', 'minute': 'min mins minute minutes', 'month': 'mon mons mnth mnths month months', 'second': 's sc scs sec secs scnd scnds second seconds', 'year': 'y ys yr yrs year years'}</dl>
214
215</td></tr></table></td></tr></table><p>
216<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
217<tr bgcolor="#eeaa77">
218<td colspan=3 valign=bottom>&nbsp;<br>
219<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
220   
221<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
222<td width="100%"><dl><dt><a name="-createList"><strong>createList</strong></a>(start, end, interval<font color="#909090">=(6, 'hour')</font>, listtype<font color="#909090">='string'</font>, formatstring<font color="#909090">='%Y-%m-%d %H:%M:%S'</font>)</dt><dd><tt>Function&nbsp;wrappper&nbsp;around&nbsp;<a href="#DateTime">DateTime</a>.<a href="#-createList">createList</a>()&nbsp;method.</tt></dd></dl>
223 <dl><dt><a name="-daysInMonth"><strong>daysInMonth</strong></a>(month, year)</dt><dd><tt>Function&nbsp;wrapper&nbsp;around&nbsp;<a href="#DateTime">DateTime</a>.getDaysInMonth()&nbsp;method.</tt></dd></dl>
224 <dl><dt><a name="-getTimeBins"><strong>getTimeBins</strong></a>(timelist)</dt><dd><tt>Function&nbsp;wrapper&nbsp;around&nbsp;<a href="#DateTime">DateTime</a>.<a href="#-getTimeBins">getTimeBins</a>()&nbsp;method.</tt></dd></dl>
225</td></tr></table><p>
226<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
227<tr bgcolor="#55aa55">
228<td colspan=3 valign=bottom>&nbsp;<br>
229<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
230   
231<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
232<td width="100%"><strong>helpMessage</strong> = '<font color="#c040c0">\n\n</font>times.py<font color="#c040c0">\n</font>========<font color="#c040c0">\n\n</font>Holds the class DateTime th...00:00:00", "1999-01-22 12:00:00", (6, "hour"))<font color="#c040c0">\n\n\n</font>'</td></tr></table>
233</body></html>
Note: See TracBrowser for help on using the repository browser.