1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
2 |
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
3 |
<title>PEAK Library: Time zone</title> |
4 |
<link href="doxygen.css" rel="stylesheet" type="text/css"> |
5 |
</head><body> |
6 |
<!-- Generated by Doxygen 1.3.5 --> |
7 |
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="functions.html">Data Fields</a></div> |
8 |
<h1>Time zone</h1><hr><a name="_details"></a><h2>Detailed Description</h2> |
9 |
Although it might look a bit off-topic, in order to provide a minimal but good time/date interface, the peak library is able to handle time zone conversion. Thanks to its design, time/date operations are efficient and a lack of time zone support would add unnecessary overhead in application's code. |
10 |
<p> |
11 |
<table border=0 cellpadding=0 cellspacing=0> |
12 |
<tr><td></td></tr> |
13 |
<tr><td colspan=2><br><h2>Typedefs</h2></td></tr> |
14 |
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="ga0" doxytag="tz::peak_tz" ></a> |
15 |
typedef __peak_tz * </td><td class="memItemRight" valign=bottom><a class="el" href="group__tz.html#ga0">peak_tz</a></td></tr> |
16 |
|
17 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Opaque time zone pointer type. <br><br></td></tr> |
18 |
<tr><td colspan=2><br><h2>Functions</h2></td></tr> |
19 |
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__tz.html#ga0">peak_tz</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__tz.html#ga1">peak_tz_create</a> (const char *tz_name)</td></tr> |
20 |
|
21 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a time zone object with a name. <a href="#ga1"></a><br><br></td></tr> |
22 |
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__tz.html#ga0">peak_tz</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__tz.html#ga2">peak_tz_create_system</a> (void)</td></tr> |
23 |
|
24 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a time zone object with current system settings. <a href="#ga2"></a><br><br></td></tr> |
25 |
<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="group__tz.html#ga3">peak_tz_get_name</a> (<a class="el" href="group__tz.html#ga0">peak_tz</a> tz)</td></tr> |
26 |
|
27 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get time zone's name. <a href="#ga3"></a><br><br></td></tr> |
28 |
<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="group__tz.html#ga4">peak_tz_get_abbreviation</a> (<a class="el" href="group__tz.html#ga0">peak_tz</a> tz, time_t t)</td></tr> |
29 |
|
30 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get time zone's abbreviation at the specified date. <a href="#ga4"></a><br><br></td></tr> |
31 |
<tr><td class="memItemLeft" nowrap align=right valign=top>time_t </td><td class="memItemRight" valign=bottom><a class="el" href="group__tz.html#ga5">peak_tz_get_gmt_offset</a> (<a class="el" href="group__tz.html#ga0">peak_tz</a> tz, time_t t)</td></tr> |
32 |
|
33 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get time zone's GMT offset at a specified date. <a href="#ga5"></a><br><br></td></tr> |
34 |
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="group__tz.html#ga6">peak_tz_is_dst</a> (<a class="el" href="group__tz.html#ga0">peak_tz</a> tz, time_t t)</td></tr> |
35 |
|
36 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns whether or not a time zone is in daylight savings time at a specified date. <a href="#ga6"></a><br><br></td></tr> |
37 |
</table> |
38 |
<hr><h2>Function Documentation</h2> |
39 |
<a class="anchor" name="ga1" doxytag="tz.h::peak_tz_create" ></a><p> |
40 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
41 |
<tr> |
42 |
<td class="mdRow"> |
43 |
<table cellpadding="0" cellspacing="0" border="0"> |
44 |
<tr> |
45 |
<td class="md" nowrap valign="top"> <a class="el" href="group__tz.html#ga0">peak_tz</a> peak_tz_create </td> |
46 |
<td class="md" valign="top">( </td> |
47 |
<td class="md" nowrap valign="top">const char * </td> |
48 |
<td class="mdname1" valign="top" nowrap> <em>tz_name</em> </td> |
49 |
<td class="md" valign="top"> ) </td> |
50 |
<td class="md" nowrap></td> |
51 |
</tr> |
52 |
|
53 |
</table> |
54 |
</td> |
55 |
</tr> |
56 |
</table> |
57 |
<table cellspacing=5 cellpadding=0 border=0> |
58 |
<tr> |
59 |
<td> |
60 |
|
61 |
</td> |
62 |
<td> |
63 |
|
64 |
<p> |
65 |
Create a time zone object with a name. |
66 |
<p> |
67 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
68 |
<table border="0" cellspacing="2" cellpadding="0"> |
69 |
<tr><td valign=top><em>tz_name</em> </td><td>Pathname of a tzfile(5)-format file from which to read the conversion information. If the first character of the pathname is a slash (`/') it is used as an absolute pathname; otherwise, it is used as a pathname relative to the system time conversion information directory (often <code>/usr/share/zoneinfo</code>).</td></tr> |
70 |
</table> |
71 |
</dl> |
72 |
<dl compact><dt><b>Returns:</b></dt><dd>New time zone reference (use <a class="el" href="group__alloc.html#ga7">peak_release()</a> when you don't need it anymore) or <code>NULL</code> if the time zone file cannot be found or another misc issue is encountered. </dd></dl> |
73 |
</td> |
74 |
</tr> |
75 |
</table> |
76 |
<a class="anchor" name="ga2" doxytag="tz.h::peak_tz_create_system" ></a><p> |
77 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
78 |
<tr> |
79 |
<td class="mdRow"> |
80 |
<table cellpadding="0" cellspacing="0" border="0"> |
81 |
<tr> |
82 |
<td class="md" nowrap valign="top"> <a class="el" href="group__tz.html#ga0">peak_tz</a> peak_tz_create_system </td> |
83 |
<td class="md" valign="top">( </td> |
84 |
<td class="md" nowrap valign="top">void </td> |
85 |
<td class="mdname1" valign="top" nowrap> </td> |
86 |
<td class="md" valign="top"> ) </td> |
87 |
<td class="md" nowrap></td> |
88 |
</tr> |
89 |
|
90 |
</table> |
91 |
</td> |
92 |
</tr> |
93 |
</table> |
94 |
<table cellspacing=5 cellpadding=0 border=0> |
95 |
<tr> |
96 |
<td> |
97 |
|
98 |
</td> |
99 |
<td> |
100 |
|
101 |
<p> |
102 |
Create a time zone object with current system settings. |
103 |
<p> |
104 |
<dl compact><dt><b>Returns:</b></dt><dd>The system's time zone reference, possibly a reference to the UTC time zone if the library doesn't understand the system's configuration or if a system's misconfiguration is encountered. Finally returns <code>NULL</code> if both attempts failed. </dd></dl> |
105 |
</td> |
106 |
</tr> |
107 |
</table> |
108 |
<a class="anchor" name="ga4" doxytag="tz.h::peak_tz_get_abbreviation" ></a><p> |
109 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
110 |
<tr> |
111 |
<td class="mdRow"> |
112 |
<table cellpadding="0" cellspacing="0" border="0"> |
113 |
<tr> |
114 |
<td class="md" nowrap valign="top"> const char* peak_tz_get_abbreviation </td> |
115 |
<td class="md" valign="top">( </td> |
116 |
<td class="md" nowrap valign="top"><a class="el" href="group__tz.html#ga0">peak_tz</a> </td> |
117 |
<td class="mdname" nowrap> <em>tz</em>, </td> |
118 |
</tr> |
119 |
<tr> |
120 |
<td></td> |
121 |
<td></td> |
122 |
<td class="md" nowrap>time_t </td> |
123 |
<td class="mdname" nowrap> <em>t</em></td> |
124 |
</tr> |
125 |
<tr> |
126 |
<td></td> |
127 |
<td class="md">) </td> |
128 |
<td class="md" colspan="2"></td> |
129 |
</tr> |
130 |
|
131 |
</table> |
132 |
</td> |
133 |
</tr> |
134 |
</table> |
135 |
<table cellspacing=5 cellpadding=0 border=0> |
136 |
<tr> |
137 |
<td> |
138 |
|
139 |
</td> |
140 |
<td> |
141 |
|
142 |
<p> |
143 |
Get time zone's abbreviation at the specified date. |
144 |
<p> |
145 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
146 |
<table border="0" cellspacing="2" cellpadding="0"> |
147 |
<tr><td valign=top><em>tz</em> </td><td>The time zone reference. </td></tr> |
148 |
<tr><td valign=top><em>t</em> </td><td>Unix time. It is required as the abbreviation may be different at different dates (eg. EDT/EST, NZDT/NZST, etc.). Use <a class="el" href="group__time.html#ga6">peak_time()</a> if you want the current abbreviation.</td></tr> |
149 |
</table> |
150 |
</dl> |
151 |
<dl compact><dt><b>Returns:</b></dt><dd>A pointer to a constant string of the abbreviation of the time zone <em>tz</em>. The string is owned by the library so don't release it and copy it if you need it for a long time. </dd></dl> |
152 |
</td> |
153 |
</tr> |
154 |
</table> |
155 |
<a class="anchor" name="ga5" doxytag="tz.h::peak_tz_get_gmt_offset" ></a><p> |
156 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
157 |
<tr> |
158 |
<td class="mdRow"> |
159 |
<table cellpadding="0" cellspacing="0" border="0"> |
160 |
<tr> |
161 |
<td class="md" nowrap valign="top"> time_t peak_tz_get_gmt_offset </td> |
162 |
<td class="md" valign="top">( </td> |
163 |
<td class="md" nowrap valign="top"><a class="el" href="group__tz.html#ga0">peak_tz</a> </td> |
164 |
<td class="mdname" nowrap> <em>tz</em>, </td> |
165 |
</tr> |
166 |
<tr> |
167 |
<td></td> |
168 |
<td></td> |
169 |
<td class="md" nowrap>time_t </td> |
170 |
<td class="mdname" nowrap> <em>t</em></td> |
171 |
</tr> |
172 |
<tr> |
173 |
<td></td> |
174 |
<td class="md">) </td> |
175 |
<td class="md" colspan="2"></td> |
176 |
</tr> |
177 |
|
178 |
</table> |
179 |
</td> |
180 |
</tr> |
181 |
</table> |
182 |
<table cellspacing=5 cellpadding=0 border=0> |
183 |
<tr> |
184 |
<td> |
185 |
|
186 |
</td> |
187 |
<td> |
188 |
|
189 |
<p> |
190 |
Get time zone's GMT offset at a specified date. |
191 |
<p> |
192 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
193 |
<table border="0" cellspacing="2" cellpadding="0"> |
194 |
<tr><td valign=top><em>tz</em> </td><td>The time zone reference. </td></tr> |
195 |
<tr><td valign=top><em>t</em> </td><td>Unix time. It is required as the offset may be different at different dates. Use <a class="el" href="group__time.html#ga6">peak_time()</a> if you want the current seconds from GMT.</td></tr> |
196 |
</table> |
197 |
</dl> |
198 |
<dl compact><dt><b>Returns:</b></dt><dd>The time interval from GMT in second. </dd></dl> |
199 |
</td> |
200 |
</tr> |
201 |
</table> |
202 |
<a class="anchor" name="ga3" doxytag="tz.h::peak_tz_get_name" ></a><p> |
203 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
204 |
<tr> |
205 |
<td class="mdRow"> |
206 |
<table cellpadding="0" cellspacing="0" border="0"> |
207 |
<tr> |
208 |
<td class="md" nowrap valign="top"> const char* peak_tz_get_name </td> |
209 |
<td class="md" valign="top">( </td> |
210 |
<td class="md" nowrap valign="top"><a class="el" href="group__tz.html#ga0">peak_tz</a> </td> |
211 |
<td class="mdname1" valign="top" nowrap> <em>tz</em> </td> |
212 |
<td class="md" valign="top"> ) </td> |
213 |
<td class="md" nowrap></td> |
214 |
</tr> |
215 |
|
216 |
</table> |
217 |
</td> |
218 |
</tr> |
219 |
</table> |
220 |
<table cellspacing=5 cellpadding=0 border=0> |
221 |
<tr> |
222 |
<td> |
223 |
|
224 |
</td> |
225 |
<td> |
226 |
|
227 |
<p> |
228 |
Get time zone's name. |
229 |
<p> |
230 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
231 |
<table border="0" cellspacing="2" cellpadding="0"> |
232 |
<tr><td valign=top><em>tz</em> </td><td>The time zone reference.</td></tr> |
233 |
</table> |
234 |
</dl> |
235 |
<dl compact><dt><b>Returns:</b></dt><dd>A pointer to a constant string of the name of the time zone <em>tz</em>. The string is owned by the library so don't release it and copy it if you need it for a long time. </dd></dl> |
236 |
</td> |
237 |
</tr> |
238 |
</table> |
239 |
<a class="anchor" name="ga6" doxytag="tz.h::peak_tz_is_dst" ></a><p> |
240 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
241 |
<tr> |
242 |
<td class="mdRow"> |
243 |
<table cellpadding="0" cellspacing="0" border="0"> |
244 |
<tr> |
245 |
<td class="md" nowrap valign="top"> int peak_tz_is_dst </td> |
246 |
<td class="md" valign="top">( </td> |
247 |
<td class="md" nowrap valign="top"><a class="el" href="group__tz.html#ga0">peak_tz</a> </td> |
248 |
<td class="mdname" nowrap> <em>tz</em>, </td> |
249 |
</tr> |
250 |
<tr> |
251 |
<td></td> |
252 |
<td></td> |
253 |
<td class="md" nowrap>time_t </td> |
254 |
<td class="mdname" nowrap> <em>t</em></td> |
255 |
</tr> |
256 |
<tr> |
257 |
<td></td> |
258 |
<td class="md">) </td> |
259 |
<td class="md" colspan="2"></td> |
260 |
</tr> |
261 |
|
262 |
</table> |
263 |
</td> |
264 |
</tr> |
265 |
</table> |
266 |
<table cellspacing=5 cellpadding=0 border=0> |
267 |
<tr> |
268 |
<td> |
269 |
|
270 |
</td> |
271 |
<td> |
272 |
|
273 |
<p> |
274 |
Returns whether or not a time zone is in daylight savings time at a specified date. |
275 |
<p> |
276 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
277 |
<table border="0" cellspacing="2" cellpadding="0"> |
278 |
<tr><td valign=top><em>tz</em> </td><td>The time zone reference. </td></tr> |
279 |
<tr><td valign=top><em>t</em> </td><td>Unix time's date for which you want to know if the time zone is in daylight savings time.</td></tr> |
280 |
</table> |
281 |
</dl> |
282 |
<dl compact><dt><b>Return values:</b></dt><dd> |
283 |
<table border="0" cellspacing="2" cellpadding="0"> |
284 |
<tr><td valign=top><em>0</em> </td><td>Normal period. </td></tr> |
285 |
<tr><td valign=top><em>1</em> </td><td>Daylight Savings Time (DST) period. </td></tr> |
286 |
</table> |
287 |
</dl> |
288 |
</td> |
289 |
</tr> |
290 |
</table> |
291 |
<hr size="1"><address style="align: right;"><small>Generated on Sat Jan 17 21:41:54 2004 for the PEAK Library by |
292 |
<a href="http://www.doxygen.org/index.html"> |
293 |
<img src="doxygen.png" alt="doxygen" align="middle" border="0" > |
294 |
</a></small> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=98146&type=1" width="88" height="31" align="middle" border="0" alt="SourceForge.net Logo" /></a></address> |
295 |
</body> |
296 |
</html> |
297 |
|