summaryrefstree
path: root/usr/share/gtk-doc/html/glib/glib-GTimeZone.html
blob: cf424f82be609d7345f97edf4df4f74366c3749a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GTimeZone</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-utilities.html" title="GLib Utilities">
<link rel="prev" href="glib-Date-and-Time-Functions.html" title="Date and Time Functions">
<link rel="next" href="glib-GDateTime.html" title="GDateTime">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<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>
<td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-GDateTime.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#glib-GTimeZone.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#glib-GTimeZone.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="glib-GTimeZone"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="glib-GTimeZone.top_of_page"></a>GTimeZone</span></h2>
<p>GTimeZone — a structure representing a time zone</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="glib-GTimeZone.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;glib.h&gt;

                    <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone">GTimeZone</a>;
<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>);
<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>);

<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>);
<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>);
<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>);

enum                <a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType">GTimeType</a>;
<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>,
                                                         <em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> type</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> time_</code></em>);
<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>,
                                                         <em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> type</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> *time_</code></em>);

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>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> interval</code></em>);
<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>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> interval</code></em>);
<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>,
                                                         <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>
</div>
<div class="refsect1">
<a name="glib-GTimeZone.description"></a><h2>Description</h2>
<p>
<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
particular point in time.  It is refcounted and immutable.
</p>
<p>
A time zone contains a number of intervals.  Each interval has
an abbreviation to describe it, an offet to UTC and a flag indicating
if the daylight savings time is in effect during that interval.  A
time zone always has at least one interval -- interval 0.
</p>
<p>
Every UTC time is contained within exactly one interval, but a given
local time may be contained within zero, one or two intervals (due to
incontinuities associated with daylight savings time).
</p>
<p>
An interval may refer to a specific period of time (eg: the duration
of daylight savings time during 2010) or it may refer to many periods
of time that share the same properties (eg: all periods of daylight
savings time).  It is also possible (usually for political reasons)
that some properties (like the abbreviation) change between intervals
without other properties changing.
</p>
<p>
<a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> is available since GLib 2.26.
</p>
</div>
<div class="refsect1">
<a name="glib-GTimeZone.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GTimeZone"></a><h3>GTimeZone</h3>
<pre class="programlisting">typedef struct _GTimeZone GTimeZone;</pre>
<p>
<a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> is an opaque structure whose members cannot be accessed
directly.
</p>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-unref"></a><h3>g_time_zone_unref ()</h3>
<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>
<p>
Decreases the reference count on <em class="parameter"><code>tz</code></em>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
<td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-ref"></a><h3>g_time_zone_ref ()</h3>
<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>
<p>
Increases the reference count on <em class="parameter"><code>tz</code></em>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
<td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new reference to <em class="parameter"><code>tz</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-new"></a><h3>g_time_zone_new ()</h3>
<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>
<p>
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>.
</p>
<p>
<em class="parameter"><code>identifier</code></em> can either be an RFC3339/ISO 8601 time offset or
something that would pass as a valid value for the
<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>).
</p>
<p>
In Windows, <em class="parameter"><code>identifier</code></em> can also be the unlocalized name of a time
zone for standard time, for example "Pacific Standard Time".
</p>
<p>
Valid RFC3339 time offsets are <code class="literal">"Z"</code> (for UTC) or
<code class="literal">"±hh:mm"</code>.  ISO 8601 additionally specifies
<code class="literal">"±hhmm"</code> and <code class="literal">"±hh"</code>.  Offsets are
time values to be added to Coordinated Universal Time (UTC) to get
the local time.
</p>
<p>
In Unix, the <code class="varname">TZ</code> environment variable typically
corresponds to the name of a file in the zoneinfo database, or
string in "std offset [dst [offset],start[/time],end[/time]]"
(POSIX) format.  There  are  no spaces in the specification.  The
name of standard and daylight savings time zone must be three or more
alphabetic characters.  Offsets are time values to be added to local
time to get Coordinated Universal Time (UTC) and should be
<code class="literal">"[±]hh[[:]mm[:ss]]"</code>.  Dates are either
<code class="literal">"Jn"</code> (Julian day with n between 1 and 365, leap
years not counted), <code class="literal">"n"</code> (zero-based Julian day
with n between 0 and 365) or <code class="literal">"Mm.w.d"</code> (day d
(0 &lt;= d &lt;= 6) of week w (1 &lt;= w &lt;= 5) of month m (1 &lt;= m &lt;= 12), day
0 is a Sunday).  Times are in local wall clock time, the default is
02:00:00.
</p>
<p>
In Windows, the "tzn[+|–]hh[:mm[:ss]][dzn]" format is used, but also
accepts POSIX format.  The Windows format uses US rules for all time
zones; daylight savings time is 60 minutes behind the standard time
with date and time of change taken from Pacific Standard Time.
Offsets are time values to be added to the local time to get
Coordinated Universal Time (UTC).
</p>
<p>
<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
<code class="varname">TZ</code> environment variable.  This function itself is
independent of the value of <code class="varname">TZ</code>, but if <em class="parameter"><code>identifier</code></em>
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
to discover the correct time zone on Unix and the registry will be
consulted or <code class="function">GetTimeZoneInformation()</code> will be used to get the local
time zone on Windows.
</p>
<p>
If intervals are not available, only time zone rules from
<code class="varname">TZ</code> environment variable or other means, then they
will be computed from year 1900 to 2037.  If the maximum year for the
rules is available and it is greater than 2037, then it will followed
instead.
</p>
<p>
See <a class="ulink" href="http://tools.ietf.org/html/rfc3339#section-5.6" target="_top">RFC3339
§5.6</a> for a precise definition of valid RFC3339 time offsets
(the <code class="varname">time-offset</code> expansion) and ISO 8601 for the
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
GNU C Library manual</a> for an explanation of the possible
values of the <code class="varname">TZ</code> environment variable.  See <a class="ulink" href="http://msdn.microsoft.com/en-us/library/ms912391%28v=winembedded.11%29.aspx" target="_top">
Microsoft Time Zone Index Values</a> for the list of time zones
on Windows.
</p>
<p>
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>
when you are done with it.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>identifier</code></em> :</span></p></td>
<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>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the requested timezone</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-new-local"></a><h3>g_time_zone_new_local ()</h3>
<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>
<p>
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
zone may change between invocations to this function; for example,
if the system administrator changes it.
</p>
<p>
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
<code class="varname">TZ</code> environment variable (including the possibility
of <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>).
</p>
<p>
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>
when you are done with it.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the local timezone</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-new-utc"></a><h3>g_time_zone_new_utc ()</h3>
<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>
<p>
Creates a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a> corresponding to UTC.
</p>
<p>
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
"Z", "UTC", "+00", etc.
</p>
<p>
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>
when you are done with it.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the universal timezone</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="GTimeType"></a><h3>enum GTimeType</h3>
<pre class="programlisting">typedef enum {
  G_TIME_TYPE_STANDARD,
  G_TIME_TYPE_DAYLIGHT,
  G_TIME_TYPE_UNIVERSAL
} GTimeType;
</pre>
<p>
Disambiguates a given time in two ways.
</p>
<p>
First, specifies if the given time is in universal or local time.
</p>
<p>
Second, if the time is in local time, specifies if it is local
standard time or local daylight time.  This is important for the case
where the same local time occurs twice (during daylight savings time
transitions, for example).
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="G-TIME-TYPE-STANDARD:CAPS"></a><span class="term"><code class="literal">G_TIME_TYPE_STANDARD</code></span></p></td>
<td>the time is in local standard time
</td>
</tr>
<tr>
<td><p><a name="G-TIME-TYPE-DAYLIGHT:CAPS"></a><span class="term"><code class="literal">G_TIME_TYPE_DAYLIGHT</code></span></p></td>
<td>the time is in local daylight time
</td>
</tr>
<tr>
<td><p><a name="G-TIME-TYPE-UNIVERSAL:CAPS"></a><span class="term"><code class="literal">G_TIME_TYPE_UNIVERSAL</code></span></p></td>
<td>the time is in UTC
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-find-interval"></a><h3>g_time_zone_find_interval ()</h3>
<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>,
                                                         <em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> type</code></em>,
                                                         <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>
<p>
Finds an the interval within <em class="parameter"><code>tz</code></em> that corresponds to the given <em class="parameter"><code>time_</code></em>.
The meaning of <em class="parameter"><code>time_</code></em> depends on <em class="parameter"><code>type</code></em>.
</p>
<p>
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
succeed (since universal time is monotonic and continuous).
</p>
<p>
Otherwise <em class="parameter"><code>time_</code></em> is treated is local time.  The distinction between
<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
the case that the given <em class="parameter"><code>time_</code></em> is ambiguous.  In Toronto, for example,
01:30 on November 7th 2010 occurred twice (once inside of daylight
savings time and the next, an hour later, outside of daylight savings
time).  In this case, the different value of <em class="parameter"><code>type</code></em> would result in a
different interval being returned.
</p>
<p>
It is still possible for this function to fail.  In Toronto, for
example, 02:00 on March 14th 2010 does not exist (due to the leap
forward to begin daylight savings time).  -1 is returned in that
case.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
<td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<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>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
<td>a number of seconds since January 1, 1970</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the interval containing <em class="parameter"><code>time_</code></em>, or -1 in case of failure</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-adjust-time"></a><h3>g_time_zone_adjust_time ()</h3>
<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>,
                                                         <em class="parameter"><code><a class="link" href="glib-GTimeZone.html#GTimeType" title="enum GTimeType"><span class="type">GTimeType</span></a> type</code></em>,
                                                         <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>
<p>
Finds an interval within <em class="parameter"><code>tz</code></em> that corresponds to the given <em class="parameter"><code>time_</code></em>,
possibly adjusting <em class="parameter"><code>time_</code></em> if required to fit into an interval.
The meaning of <em class="parameter"><code>time_</code></em> depends on <em class="parameter"><code>type</code></em>.
</p>
<p>
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
difference that it always succeeds (by making the adjustments
described below).
</p>
<p>
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
this function returns the same value, without modifying <em class="parameter"><code>time_</code></em>.
</p>
<p>
This function may, however, modify <em class="parameter"><code>time_</code></em> in order to deal with
non-existent times.  If the non-existent local <em class="parameter"><code>time_</code></em> of 02:30 were
requested on March 14th 2010 in Toronto then this function would
adjust <em class="parameter"><code>time_</code></em> to be 03:00 and return the interval containing the
adjusted time.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
<td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<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>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
<td>a pointer to a number of seconds since January 1, 1970</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the interval containing <em class="parameter"><code>time_</code></em>, never -1</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-get-abbreviation"></a><h3>g_time_zone_get_abbreviation ()</h3>
<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>,
                                                         <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>
<p>
Determines the time zone abbreviation to be used during a particular
<em class="parameter"><code>interval</code></em> of time in the time zone <em class="parameter"><code>tz</code></em>.
</p>
<p>
For example, in Toronto this is currently "EST" during the winter
months and "EDT" during the summer months when daylight savings time
is in effect.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
<td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
<td>an interval within the timezone</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the time zone abbreviation, which belongs to <em class="parameter"><code>tz</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-get-offset"></a><h3>g_time_zone_get_offset ()</h3>
<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>,
                                                         <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>
<p>
Determines the offset to UTC in effect during a particular <em class="parameter"><code>interval</code></em>
of time in the time zone <em class="parameter"><code>tz</code></em>.
</p>
<p>
The offset is the number of seconds that you add to UTC time to
arrive at local time for <em class="parameter"><code>tz</code></em> (ie: negative numbers for time zones
west of GMT, positive numbers for east).
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
<td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
<td>an interval within the timezone</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the number of seconds that should be added to UTC to get the
local time in <em class="parameter"><code>tz</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-time-zone-is-dst"></a><h3>g_time_zone_is_dst ()</h3>
<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>,
                                                         <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>
<p>
Determines if daylight savings time is in effect during a particular
<em class="parameter"><code>interval</code></em> of time in the time zone <em class="parameter"><code>tz</code></em>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>tz</code></em> :</span></p></td>
<td>a <a class="link" href="glib-GTimeZone.html#GTimeZone" title="GTimeZone"><span class="type">GTimeZone</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
<td>an interval within the timezone</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<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>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
</div>
<div class="refsect1">
<a name="glib-GTimeZone.see-also"></a><h2>See Also</h2>
<a class="link" href="glib-GDateTime.html#GDateTime" title="GDateTime"><span class="type">GDateTime</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.19</div>
</body>
</html>