123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338 |
- <!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.79.2">
- <link rel="home" href="index.html" title="">
- <link rel="up" href="ch01.html" title="GLib">
- <link rel="prev" href="re68.html" title="<%GLibTimeType>">
- <link rel="next" href="re70.html" title="<%GLibTokenType>">
- <meta name="generator" content="GTK-Doc V1.33.1 (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="5"><tr valign="middle">
- <td width="100%" align="left" class="shortcuts"></td>
- <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
- <td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
- <td><a accesskey="p" href="re68.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
- <td><a accesskey="n" href="re70.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
- </tr></table>
- <div class="refentry">
- <a name="id-1.1.70"></a><div class="titlepage"></div>
- <div class="refnamediv">
- <h2><GTimeZone></h2>
- <p><GTimeZone></p>
- </div>
- <div class="refsect1">
- <a name="id-1.1.70.2"></a><h2>Description</h2>
- <p><span class="type">GTimeZone</span> is an opaque structure whose members cannot be accessed
- directly.</p>
- </div>
- <div class="refsect1">
- <a name="id-1.1.70.3"></a><h2>Functions</h2>
- <div class="refsect2">
- <a name="id-1.1.70.3.2"></a><h3>adjust-time</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:adjust-time self type time-))
- </pre></div>
- <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 <code class="function">g_time_zone_find_interval()</code>, with the
- difference that it always succeeds (by making the adjustments
- described below).
- </p>
- <p>In any of the cases where <code class="function">g_time_zone_find_interval()</code> 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="refsect3">
- <a name="id-1.1.70.3.2.7"></a><h4>Parameters</h4>
- <div class="informaltable"><table>
- <tr>
- <td class="parameter_name"><p>tz</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GTimeZone</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr>
- <tr>
- <td class="parameter_name"><p>type</p></td>
- <td class="parameter_description">
- <p>the <span class="type">GTimeType</span> of <em class="parameter"><code>time_</code></em></p>
- <p>Passed as <code class="code">type</code></p>
- </td>
- </tr>
- <tr>
- <td class="parameter_name"><p>time_</p></td>
- <td class="parameter_description">
- <p>a pointer to a number of seconds since January 1, 1970</p>
- <p>Passed as <code class="code">time-</code></p>
- </td>
- </tr>
- </table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.3"></a><h3>find-interval</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:find-interval self type time-))
- </pre></div>
- <p>Finds an 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 <code class="constant">G_TIME_TYPE_UNIVERSAL</code> 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 as local time. The distinction between
- <code class="constant">G_TIME_TYPE_STANDARD</code> and <code class="constant">G_TIME_TYPE_DAYLIGHT</code> 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="refsect3">
- <a name="id-1.1.70.3.3.7"></a><h4>Parameters</h4>
- <div class="informaltable"><table>
- <tr>
- <td class="parameter_name"><p>tz</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GTimeZone</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr>
- <tr>
- <td class="parameter_name"><p>type</p></td>
- <td class="parameter_description">
- <p>the <span class="type">GTimeType</span> of <em class="parameter"><code>time_</code></em></p>
- <p>Passed as <code class="code">type</code></p>
- </td>
- </tr>
- <tr>
- <td class="parameter_name"><p>time_</p></td>
- <td class="parameter_description">
- <p>a number of seconds since January 1, 1970</p>
- <p>Passed as <code class="code">time-</code></p>
- </td>
- </tr>
- </table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.4"></a><h3>get-abbreviation</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:get-abbreviation self interval))
- </pre></div>
- <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="refsect3">
- <a name="id-1.1.70.3.4.5"></a><h4>Parameters</h4>
- <div class="informaltable"><table>
- <tr>
- <td class="parameter_name"><p>tz</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GTimeZone</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr>
- <tr>
- <td class="parameter_name"><p>interval</p></td>
- <td class="parameter_description">
- <p>an interval within the timezone</p>
- <p>Passed as <code class="code">interval</code></p>
- </td>
- </tr>
- </table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.5"></a><h3>get-identifier</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:get-identifier self))
- </pre></div>
- <p>Get the identifier of this <span class="type">GTimeZone</span>, as passed to <code class="function">g_time_zone_new()</code>.
- If the identifier passed at construction time was not recognised, <code class="code">UTC</code> will
- be returned. If it was <code class="constant">NULL</code>, the identifier of the local timezone at
- construction time will be returned.
- </p>
- <p>The identifier will be returned in the same format as provided at
- construction time: if provided as a time offset, that will be returned by
- this function.</p>
- <div class="refsect3">
- <a name="id-1.1.70.3.5.5"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>tz</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GTimeZone</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.6"></a><h3>get-offset</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:get-offset self interval))
- </pre></div>
- <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="refsect3">
- <a name="id-1.1.70.3.6.5"></a><h4>Parameters</h4>
- <div class="informaltable"><table>
- <tr>
- <td class="parameter_name"><p>tz</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GTimeZone</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr>
- <tr>
- <td class="parameter_name"><p>interval</p></td>
- <td class="parameter_description">
- <p>an interval within the timezone</p>
- <p>Passed as <code class="code">interval</code></p>
- </td>
- </tr>
- </table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.7"></a><h3>is-dst?</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:is-dst? self interval))
- </pre></div>
- <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="refsect3">
- <a name="id-1.1.70.3.7.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table>
- <tr>
- <td class="parameter_name"><p>tz</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GTimeZone</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr>
- <tr>
- <td class="parameter_name"><p>interval</p></td>
- <td class="parameter_description">
- <p>an interval within the timezone</p>
- <p>Passed as <code class="code">interval</code></p>
- </td>
- </tr>
- </table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.8"></a><h3>ref</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:ref self))
- </pre></div>
- <p>Increases the reference count on <em class="parameter"><code>tz</code></em>.</p>
- <div class="refsect3">
- <a name="id-1.1.70.3.8.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>tz</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GTimeZone</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.9"></a><h3>unref</h3>
- <div class="informalexample"><pre class="programlisting">(define-values () (time-zone:unref self))
- </pre></div>
- <p>Decreases the reference count on <em class="parameter"><code>tz</code></em>.</p>
- <div class="refsect3">
- <a name="id-1.1.70.3.9.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>tz</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GTimeZone</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.10"></a><h3>time-zone:new-utc</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-utc))
- </pre></div>
- <p>Undocumented</p>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.11"></a><h3>time-zone:new-offset</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-offset seconds))
- </pre></div>
- <p>Undocumented</p>
- <div class="refsect3">
- <a name="id-1.1.70.3.11.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>seconds</p></td>
- <td class="parameter_description">
- <p></p>
- <p>Passed as <code class="code">seconds</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.12"></a><h3>time-zone:new-local</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-local))
- </pre></div>
- <p>Undocumented</p>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.13"></a><h3>time-zone:new-identifier</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-identifier identifier))
- </pre></div>
- <p>Undocumented</p>
- <div class="refsect3">
- <a name="id-1.1.70.3.13.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>identifier</p></td>
- <td class="parameter_description">
- <p></p>
- <p>Passed as <code class="code">identifier</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.70.3.14"></a><h3>time-zone:new</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new identifier))
- </pre></div>
- <p>Undocumented</p>
- <div class="refsect3">
- <a name="id-1.1.70.3.14.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>identifier</p></td>
- <td class="parameter_description">
- <p></p>
- <p>Passed as <code class="code">identifier</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- </div>
- </div>
- <div class="footer">
- <hr>Generated by GTK-Doc V1.33.1</div>
- </body>
- </html>
|