Moving files to packaging and extracing new tarball.
[profile/ivi/glib2.git] / docs / reference / glib / html / glib-GTimeZone.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GTimeZone</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GLib Reference Manual">
8 <link rel="up" href="glib-utilities.html" title="GLib Utilities">
9 <link rel="prev" href="glib-Date-and-Time-Functions.html" title="Date and Time Functions">
10 <link rel="next" href="glib-GDateTime.html" title="GDateTime">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="glib-Date-and-Time-Functions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GLib Reference Manual</th>
21 <td><a accesskey="n" href="glib-GDateTime.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#glib-GTimeZone.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#glib-GTimeZone.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="glib-GTimeZone"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="glib-GTimeZone.top_of_page"></a>GTimeZone</span></h2>
34 <p>GTimeZone — a structure representing a time zone</p>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="glib-GTimeZone.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">
41 #include &lt;glib.h&gt;
42
43                     <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone">GTimeZone</a>;
44 <span class="returnvalue">void</span>                <a class="link" href="glib-GTimeZone.html#g-time-zone-unref" title="g_time_zone_unref ()">g_time_zone_unref</a>                   (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>);
45 <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="returnvalue">GTimeZone</span></a> *         <a class="link" href="glib-GTimeZone.html#g-time-zone-ref" title="g_time_zone_ref ()">g_time_zone_ref</a>                     (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>);
46
47 <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="returnvalue">GTimeZone</span></a> *         <a class="link" href="glib-GTimeZone.html#g-time-zone-new" title="g_time_zone_new ()">g_time_zone_new</a>                     (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *identifier</code></em>);
48 <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="returnvalue">GTimeZone</span></a> *         <a class="link" href="glib-GTimeZone.html#g-time-zone-new-local" title="g_time_zone_new_local ()">g_time_zone_new_local</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
49 <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="returnvalue">GTimeZone</span></a> *         <a class="link" href="glib-GTimeZone.html#g-time-zone-new-utc" title="g_time_zone_new_utc ()">g_time_zone_new_utc</a>                 (<em class="parameter"><code><span class="type">void</span></code></em>);
50
51 enum                <a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType">GTimeType</a>;
52 <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a>                <a class="link" href="glib-GTimeZone.html#g-time-zone-find-interval" title="g_time_zone_find_interval ()">g_time_zone_find_interval</a>           (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
53                                                          <em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> type</code></em>,
54                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> time_</code></em>);
55 <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a>                <a class="link" href="glib-GTimeZone.html#g-time-zone-adjust-time" title="g_time_zone_adjust_time ()">g_time_zone_adjust_time</a>             (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
56                                                          <em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> type</code></em>,
57                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> *time_</code></em>);
58
59 const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="glib-GTimeZone.html#g-time-zone-get-abbreviation" title="g_time_zone_get_abbreviation ()">g_time_zone_get_abbreviation</a>        (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
60                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> interval</code></em>);
61 <a class="link" href="glib-Basic-Types.html#gint32" title="gint32"><span class="returnvalue">gint32</span></a>              <a class="link" href="glib-GTimeZone.html#g-time-zone-get-offset" title="g_time_zone_get_offset ()">g_time_zone_get_offset</a>              (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
62                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> interval</code></em>);
63 <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="glib-GTimeZone.html#g-time-zone-is-dst" title="g_time_zone_is_dst ()">g_time_zone_is_dst</a>                  (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
64                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> interval</code></em>);
65 </pre>
66 </div>
67 <div class="refsect1">
68 <a name="glib-GTimeZone.description"></a><h2>Description</h2>
69 <p>
70 <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> is a structure that represents a time zone, at no
71 particular point in time.  It is refcounted and immutable.
72 </p>
73 <p>
74 A time zone contains a number of intervals.  Each interval has
75 an abbreviation to describe it, an offet to UTC and a flag indicating
76 if the daylight savings time is in effect during that interval.  A
77 time zone always has at least one interval -- interval 0.
78 </p>
79 <p>
80 Every UTC time is contained within exactly one interval, but a given
81 local time may be contained within zero, one or two intervals (due to
82 incontinuities associated with daylight savings time).
83 </p>
84 <p>
85 An interval may refer to a specific period of time (eg: the duration
86 of daylight savings time during 2010) or it may refer to many periods
87 of time that share the same properties (eg: all periods of daylight
88 savings time).  It is also possible (usually for political reasons)
89 that some properties (like the abbreviation) change between intervals
90 without other properties changing.
91 </p>
92 <p>
93 <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> is available since GLib 2.26.
94 </p>
95 </div>
96 <div class="refsect1">
97 <a name="glib-GTimeZone.details"></a><h2>Details</h2>
98 <div class="refsect2">
99 <a name="GTimeZone"></a><h3>GTimeZone</h3>
100 <pre class="programlisting">typedef struct _GTimeZone GTimeZone;</pre>
101 <p>
102 <a class="link" href="glib-GDateTime.html#GDateTime" title="GDateTime"><span class="type">GDateTime</span></a> is an opaque structure whose members cannot be accessed
103 directly.
104 </p>
105 <p class="since">Since 2.26</p>
106 </div>
107 <hr>
108 <div class="refsect2">
109 <a name="g-time-zone-unref"></a><h3>g_time_zone_unref ()</h3>
110 <pre class="programlisting"><span class="returnvalue">void</span>                g_time_zone_unref                   (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>);</pre>
111 <p>
112 Decreases the reference count on <em class="parameter"><code>tz</code></em>.
113 </p>
114 <div class="variablelist"><table border="0">
115 <col align="left" valign="top">
116 <tbody><tr>
117 <td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
118 <td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
119 </td>
120 </tr></tbody>
121 </table></div>
122 <p class="since">Since 2.26</p>
123 </div>
124 <hr>
125 <div class="refsect2">
126 <a name="g-time-zone-ref"></a><h3>g_time_zone_ref ()</h3>
127 <pre class="programlisting"><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="returnvalue">GTimeZone</span></a> *         g_time_zone_ref                     (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>);</pre>
128 <p>
129 Increases the reference count on <em class="parameter"><code>tz</code></em>.
130 </p>
131 <div class="variablelist"><table border="0">
132 <col align="left" valign="top">
133 <tbody>
134 <tr>
135 <td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
136 <td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
137 </td>
138 </tr>
139 <tr>
140 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
141 <td>a new reference to <em class="parameter"><code>tz</code></em>.</td>
142 </tr>
143 </tbody>
144 </table></div>
145 <p class="since">Since 2.26</p>
146 </div>
147 <hr>
148 <div class="refsect2">
149 <a name="g-time-zone-new"></a><h3>g_time_zone_new ()</h3>
150 <pre class="programlisting"><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="returnvalue">GTimeZone</span></a> *         g_time_zone_new                     (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *identifier</code></em>);</pre>
151 <p>
152 Creates a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> corresponding to <em class="parameter"><code>identifier</code></em>.
153 </p>
154 <p>
155 <em class="parameter"><code>identifier</code></em> can either be an RFC3339/ISO 8601 time offset or
156 something that would pass as a valid value for the
157 <code class="varname">TZ</code> environment variable (including <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>).
158 </p>
159 <p>
160 Valid RFC3339 time offsets are <code class="literal">"Z"</code> (for UTC) or
161 <code class="literal">"±hh:mm"</code>.  ISO 8601 additionally specifies
162 <code class="literal">"±hhmm"</code> and <code class="literal">"±hh"</code>.
163 </p>
164 <p>
165 The <code class="varname">TZ</code> environment variable typically corresponds
166 to the name of a file in the zoneinfo database, but there are many
167 other possibilities.  Note that those other possibilities are not
168 currently implemented, but are planned.
169 </p>
170 <p>
171 <a class="link" href="glib-GTimeZone.html#g-time-zone-new-local" title="g_time_zone_new_local ()"><code class="function">g_time_zone_new_local()</code></a> calls this function with the value of the
172 <code class="varname">TZ</code> environment variable.  This function itself is
173 independent of the value of <code class="varname">TZ</code>, but if <em class="parameter"><code>identifier</code></em>
174 is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> then <code class="filename">/etc/localtime</code> will be consulted
175 to discover the correct timezone.
176 </p>
177 <p>
178 See <a class="ulink" href="http://tools.ietf.org/html/rfc3339#section-5.6" target="_top">RFC3339
179 §5.6</a> for a precise definition of valid RFC3339 time offsets
180 (the <code class="varname">time-offset</code> expansion) and ISO 8601 for the
181 full list of valid time offsets.  See <a class="ulink" href="http://www.gnu.org/s/libc/manual/html_node/TZ-Variable.html" target="_top">The
182 GNU C Library manual</a> for an explanation of the possible
183 values of the <code class="varname">TZ</code> environment variable.
184 </p>
185 <p>
186 You should release the return value by calling <a class="link" href="glib-GTimeZone.html#g-time-zone-unref" title="g_time_zone_unref ()"><code class="function">g_time_zone_unref()</code></a>
187 when you are done with it.
188 </p>
189 <div class="variablelist"><table border="0">
190 <col align="left" valign="top">
191 <tbody>
192 <tr>
193 <td><p><span class="term"><em class="parameter"><code>identifier</code></em> :</span></p></td>
194 <td>a timezone identifier. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
195 </td>
196 </tr>
197 <tr>
198 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
199 <td>the requested timezone</td>
200 </tr>
201 </tbody>
202 </table></div>
203 <p class="since">Since 2.26</p>
204 </div>
205 <hr>
206 <div class="refsect2">
207 <a name="g-time-zone-new-local"></a><h3>g_time_zone_new_local ()</h3>
208 <pre class="programlisting"><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="returnvalue">GTimeZone</span></a> *         g_time_zone_new_local               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
209 <p>
210 Creates a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> corresponding to local time.  The local time
211 zone may change between invocations to this function; for example,
212 if the system administrator changes it.
213 </p>
214 <p>
215 This is equivalent to calling <a class="link" href="glib-GTimeZone.html#g-time-zone-new" title="g_time_zone_new ()"><code class="function">g_time_zone_new()</code></a> with the value of the
216 <code class="varname">TZ</code> environment variable (including the possibility
217 of <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>).
218 </p>
219 <p>
220 You should release the return value by calling <a class="link" href="glib-GTimeZone.html#g-time-zone-unref" title="g_time_zone_unref ()"><code class="function">g_time_zone_unref()</code></a>
221 when you are done with it.
222 </p>
223 <div class="variablelist"><table border="0">
224 <col align="left" valign="top">
225 <tbody><tr>
226 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
227 <td>the local timezone</td>
228 </tr></tbody>
229 </table></div>
230 <p class="since">Since 2.26</p>
231 </div>
232 <hr>
233 <div class="refsect2">
234 <a name="g-time-zone-new-utc"></a><h3>g_time_zone_new_utc ()</h3>
235 <pre class="programlisting"><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="returnvalue">GTimeZone</span></a> *         g_time_zone_new_utc                 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
236 <p>
237 Creates a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> corresponding to UTC.
238 </p>
239 <p>
240 This is equivalent to calling <a class="link" href="glib-GTimeZone.html#g-time-zone-new" title="g_time_zone_new ()"><code class="function">g_time_zone_new()</code></a> with a value like
241 "Z", "UTC", "+00", etc.
242 </p>
243 <p>
244 You should release the return value by calling <a class="link" href="glib-GTimeZone.html#g-time-zone-unref" title="g_time_zone_unref ()"><code class="function">g_time_zone_unref()</code></a>
245 when you are done with it.
246 </p>
247 <div class="variablelist"><table border="0">
248 <col align="left" valign="top">
249 <tbody><tr>
250 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
251 <td>the universal timezone</td>
252 </tr></tbody>
253 </table></div>
254 <p class="since">Since 2.26</p>
255 </div>
256 <hr>
257 <div class="refsect2">
258 <a name="GTimeType"></a><h3>enum GTimeType</h3>
259 <pre class="programlisting">typedef enum {
260   G_TIME_TYPE_STANDARD,
261   G_TIME_TYPE_DAYLIGHT,
262   G_TIME_TYPE_UNIVERSAL
263 } GTimeType;
264 </pre>
265 <p>
266 Disambiguates a given time in two ways.
267 </p>
268 <p>
269 First, specifies if the given time is in universal or local time.
270 </p>
271 <p>
272 Second, if the time is in local time, specifies if it is local
273 standard time or local daylight time.  This is important for the case
274 where the same local time occurs twice (during daylight savings time
275 transitions, for example).
276 </p>
277 <div class="variablelist"><table border="0">
278 <col align="left" valign="top">
279 <tbody>
280 <tr>
281 <td><p><a name="G-TIME-TYPE-STANDARD:CAPS"></a><span class="term"><code class="literal">G_TIME_TYPE_STANDARD</code></span></p></td>
282 <td>the time is in local standard time
283 </td>
284 </tr>
285 <tr>
286 <td><p><a name="G-TIME-TYPE-DAYLIGHT:CAPS"></a><span class="term"><code class="literal">G_TIME_TYPE_DAYLIGHT</code></span></p></td>
287 <td>the time is in local daylight time
288 </td>
289 </tr>
290 <tr>
291 <td><p><a name="G-TIME-TYPE-UNIVERSAL:CAPS"></a><span class="term"><code class="literal">G_TIME_TYPE_UNIVERSAL</code></span></p></td>
292 <td>the time is in UTC
293 </td>
294 </tr>
295 </tbody>
296 </table></div>
297 </div>
298 <hr>
299 <div class="refsect2">
300 <a name="g-time-zone-find-interval"></a><h3>g_time_zone_find_interval ()</h3>
301 <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a>                g_time_zone_find_interval           (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
302                                                          <em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> type</code></em>,
303                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> time_</code></em>);</pre>
304 <p>
305 Finds an the interval within <em class="parameter"><code>tz</code></em> that corresponds to the given <em class="parameter"><code>time_</code></em>.
306 The meaning of <em class="parameter"><code>time_</code></em> depends on <em class="parameter"><code>type</code></em>.
307 </p>
308 <p>
309 If <em class="parameter"><code>type</code></em> is <a class="link" href="glib-GTimeZone.html#G-TIME-TYPE-UNIVERSAL:CAPS"><code class="literal">G_TIME_TYPE_UNIVERSAL</code></a> then this function will always
310 succeed (since universal time is monotonic and continuous).
311 </p>
312 <p>
313 Otherwise <em class="parameter"><code>time_</code></em> is treated is local time.  The distinction between
314 <a class="link" href="glib-GTimeZone.html#G-TIME-TYPE-STANDARD:CAPS"><code class="literal">G_TIME_TYPE_STANDARD</code></a> and <a class="link" href="glib-GTimeZone.html#G-TIME-TYPE-DAYLIGHT:CAPS"><code class="literal">G_TIME_TYPE_DAYLIGHT</code></a> is ignored except in
315 the case that the given <em class="parameter"><code>time_</code></em> is ambiguous.  In Toronto, for example,
316 01:30 on November 7th 2010 occurred twice (once inside of daylight
317 savings time and the next, an hour later, outside of daylight savings
318 time).  In this case, the different value of <em class="parameter"><code>type</code></em> would result in a
319 different interval being returned.
320 </p>
321 <p>
322 It is still possible for this function to fail.  In Toronto, for
323 example, 02:00 on March 14th 2010 does not exist (due to the leap
324 forward to begin daylight savings time).  -1 is returned in that
325 case.
326 </p>
327 <div class="variablelist"><table border="0">
328 <col align="left" valign="top">
329 <tbody>
330 <tr>
331 <td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
332 <td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
333 </td>
334 </tr>
335 <tr>
336 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
337 <td>the <a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> of <em class="parameter"><code>time_</code></em>
338 </td>
339 </tr>
340 <tr>
341 <td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
342 <td>a number of seconds since January 1, 1970</td>
343 </tr>
344 <tr>
345 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
346 <td>the interval containing <em class="parameter"><code>time_</code></em>, or -1 in case of failure</td>
347 </tr>
348 </tbody>
349 </table></div>
350 <p class="since">Since 2.26</p>
351 </div>
352 <hr>
353 <div class="refsect2">
354 <a name="g-time-zone-adjust-time"></a><h3>g_time_zone_adjust_time ()</h3>
355 <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a>                g_time_zone_adjust_time             (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
356                                                          <em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> type</code></em>,
357                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> *time_</code></em>);</pre>
358 <p>
359 Finds an interval within <em class="parameter"><code>tz</code></em> that corresponds to the given <em class="parameter"><code>time_</code></em>,
360 possibly adjusting <em class="parameter"><code>time_</code></em> if required to fit into an interval.
361 The meaning of <em class="parameter"><code>time_</code></em> depends on <em class="parameter"><code>type</code></em>.
362 </p>
363 <p>
364 This function is similar to <a class="link" href="glib-GTimeZone.html#g-time-zone-find-interval" title="g_time_zone_find_interval ()"><code class="function">g_time_zone_find_interval()</code></a>, with the
365 difference that it always succeeds (by making the adjustments
366 described below).
367 </p>
368 <p>
369 In any of the cases where <a class="link" href="glib-GTimeZone.html#g-time-zone-find-interval" title="g_time_zone_find_interval ()"><code class="function">g_time_zone_find_interval()</code></a> succeeds then
370 this function returns the same value, without modifying <em class="parameter"><code>time_</code></em>.
371 </p>
372 <p>
373 This function may, however, modify <em class="parameter"><code>time_</code></em> in order to deal with
374 non-existent times.  If the non-existent local <em class="parameter"><code>time_</code></em> of 02:30 were
375 requested on March 13th 2010 in Toronto then this function would
376 adjust <em class="parameter"><code>time_</code></em> to be 03:00 and return the interval containing the
377 adjusted time.
378 </p>
379 <div class="variablelist"><table border="0">
380 <col align="left" valign="top">
381 <tbody>
382 <tr>
383 <td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
384 <td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
385 </td>
386 </tr>
387 <tr>
388 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
389 <td>the <a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> of <em class="parameter"><code>time_</code></em>
390 </td>
391 </tr>
392 <tr>
393 <td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
394 <td>a pointer to a number of seconds since January 1, 1970</td>
395 </tr>
396 <tr>
397 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
398 <td>the interval containing <em class="parameter"><code>time_</code></em>, never -1</td>
399 </tr>
400 </tbody>
401 </table></div>
402 <p class="since">Since 2.26</p>
403 </div>
404 <hr>
405 <div class="refsect2">
406 <a name="g-time-zone-get-abbreviation"></a><h3>g_time_zone_get_abbreviation ()</h3>
407 <pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *       g_time_zone_get_abbreviation        (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
408                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> interval</code></em>);</pre>
409 <p>
410 Determines the time zone abbreviation to be used during a particular
411 <em class="parameter"><code>interval</code></em> of time in the time zone <em class="parameter"><code>tz</code></em>.
412 </p>
413 <p>
414 For example, in Toronto this is currently "EST" during the winter
415 months and "EDT" during the summer months when daylight savings time
416 is in effect.
417 </p>
418 <div class="variablelist"><table border="0">
419 <col align="left" valign="top">
420 <tbody>
421 <tr>
422 <td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
423 <td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
424 </td>
425 </tr>
426 <tr>
427 <td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
428 <td>an interval within the timezone</td>
429 </tr>
430 <tr>
431 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
432 <td>the time zone abbreviation, which belongs to <em class="parameter"><code>tz</code></em>
433 </td>
434 </tr>
435 </tbody>
436 </table></div>
437 <p class="since">Since 2.26</p>
438 </div>
439 <hr>
440 <div class="refsect2">
441 <a name="g-time-zone-get-offset"></a><h3>g_time_zone_get_offset ()</h3>
442 <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint32" title="gint32"><span class="returnvalue">gint32</span></a>              g_time_zone_get_offset              (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
443                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> interval</code></em>);</pre>
444 <p>
445 Determines the offset to UTC in effect during a particular <em class="parameter"><code>interval</code></em>
446 of time in the time zone <em class="parameter"><code>tz</code></em>.
447 </p>
448 <p>
449 The offset is the number of seconds that you add to UTC time to
450 arrive at local time for <em class="parameter"><code>tz</code></em> (ie: negative numbers for time zones
451 west of GMT, positive numbers for east).
452 </p>
453 <div class="variablelist"><table border="0">
454 <col align="left" valign="top">
455 <tbody>
456 <tr>
457 <td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
458 <td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
459 </td>
460 </tr>
461 <tr>
462 <td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
463 <td>an interval within the timezone</td>
464 </tr>
465 <tr>
466 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
467 <td>the number of seconds that should be added to UTC to get the
468 local time in <em class="parameter"><code>tz</code></em>
469 </td>
470 </tr>
471 </tbody>
472 </table></div>
473 <p class="since">Since 2.26</p>
474 </div>
475 <hr>
476 <div class="refsect2">
477 <a name="g-time-zone-is-dst"></a><h3>g_time_zone_is_dst ()</h3>
478 <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            g_time_zone_is_dst                  (<em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> *tz</code></em>,
479                                                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> interval</code></em>);</pre>
480 <p>
481 Determines if daylight savings time is in effect during a particular
482 <em class="parameter"><code>interval</code></em> of time in the time zone <em class="parameter"><code>tz</code></em>.
483 </p>
484 <div class="variablelist"><table border="0">
485 <col align="left" valign="top">
486 <tbody>
487 <tr>
488 <td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
489 <td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
490 </td>
491 </tr>
492 <tr>
493 <td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
494 <td>an interval within the timezone</td>
495 </tr>
496 <tr>
497 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
498 <td>
499 <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if daylight savings time is in effect</td>
500 </tr>
501 </tbody>
502 </table></div>
503 <p class="since">Since 2.26</p>
504 </div>
505 </div>
506 <div class="refsect1">
507 <a name="glib-GTimeZone.see-also"></a><h2>See Also</h2>
508 <a class="link" href="glib-GDateTime.html#GDateTime" title="GDateTime"><span class="type">GDateTime</span></a>
509 </div>
510 </div>
511 <div class="footer">
512 <hr>
513           Generated by GTK-Doc V1.18</div>
514 </body>
515 </html>