re69.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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>&lt;GTimeZone&gt;: </title>
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
  7. <link rel="home" href="index.html" title="">
  8. <link rel="up" href="ch01.html" title="GLib">
  9. <link rel="prev" href="re68.html" title="&lt;%GLibTimeType&gt;">
  10. <link rel="next" href="re70.html" title="&lt;%GLibTokenType&gt;">
  11. <meta name="generator" content="GTK-Doc V1.33.1 (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="5"><tr valign="middle">
  16. <td width="100%" align="left" class="shortcuts"></td>
  17. <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
  18. <td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
  19. <td><a accesskey="p" href="re68.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
  20. <td><a accesskey="n" href="re70.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
  21. </tr></table>
  22. <div class="refentry">
  23. <a name="id-1.1.70"></a><div class="titlepage"></div>
  24. <div class="refnamediv">
  25. <h2>&lt;GTimeZone&gt;</h2>
  26. <p>&lt;GTimeZone&gt;</p>
  27. </div>
  28. <div class="refsect1">
  29. <a name="id-1.1.70.2"></a><h2>Description</h2>
  30. <p><span class="type">GTimeZone</span> is an opaque structure whose members cannot be accessed
  31. directly.</p>
  32. </div>
  33. <div class="refsect1">
  34. <a name="id-1.1.70.3"></a><h2>Functions</h2>
  35. <div class="refsect2">
  36. <a name="id-1.1.70.3.2"></a><h3>adjust-time</h3>
  37. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:adjust-time self type time-))
  38. </pre></div>
  39. <p>Finds an interval within <em class="parameter"><code>tz</code></em> that corresponds to the given <em class="parameter"><code>time_</code></em>,
  40. possibly adjusting <em class="parameter"><code>time_</code></em> if required to fit into an interval.
  41. The meaning of <em class="parameter"><code>time_</code></em> depends on <em class="parameter"><code>type</code></em>.
  42. </p>
  43. <p>This function is similar to <code class="function">g_time_zone_find_interval()</code>, with the
  44. difference that it always succeeds (by making the adjustments
  45. described below).
  46. </p>
  47. <p>In any of the cases where <code class="function">g_time_zone_find_interval()</code> succeeds then
  48. this function returns the same value, without modifying <em class="parameter"><code>time_</code></em>.
  49. </p>
  50. <p>This function may, however, modify <em class="parameter"><code>time_</code></em> in order to deal with
  51. non-existent times. If the non-existent local <em class="parameter"><code>time_</code></em> of 02:30 were
  52. requested on March 14th 2010 in Toronto then this function would
  53. adjust <em class="parameter"><code>time_</code></em> to be 03:00 and return the interval containing the
  54. adjusted time.</p>
  55. <div class="refsect3">
  56. <a name="id-1.1.70.3.2.7"></a><h4>Parameters</h4>
  57. <div class="informaltable"><table>
  58. <tr>
  59. <td class="parameter_name"><p>tz</p></td>
  60. <td class="parameter_description">
  61. <p>a <span class="type">GTimeZone</span></p>
  62. <p>Passed as <code class="code">self</code></p>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td class="parameter_name"><p>type</p></td>
  67. <td class="parameter_description">
  68. <p>the <span class="type">GTimeType</span> of <em class="parameter"><code>time_</code></em></p>
  69. <p>Passed as <code class="code">type</code></p>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td class="parameter_name"><p>time_</p></td>
  74. <td class="parameter_description">
  75. <p>a pointer to a number of seconds since January 1, 1970</p>
  76. <p>Passed as <code class="code">time-</code></p>
  77. </td>
  78. </tr>
  79. </table></div>
  80. </div>
  81. </div>
  82. <div class="refsect2">
  83. <a name="id-1.1.70.3.3"></a><h3>find-interval</h3>
  84. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:find-interval self type time-))
  85. </pre></div>
  86. <p>Finds an interval within <em class="parameter"><code>tz</code></em> that corresponds to the given <em class="parameter"><code>time_</code></em>.
  87. The meaning of <em class="parameter"><code>time_</code></em> depends on <em class="parameter"><code>type</code></em>.
  88. </p>
  89. <p>If <em class="parameter"><code>type</code></em> is <code class="constant">G_TIME_TYPE_UNIVERSAL</code> then this function will always
  90. succeed (since universal time is monotonic and continuous).
  91. </p>
  92. <p>Otherwise <em class="parameter"><code>time_</code></em> is treated as local time. The distinction between
  93. <code class="constant">G_TIME_TYPE_STANDARD</code> and <code class="constant">G_TIME_TYPE_DAYLIGHT</code> is ignored except in
  94. the case that the given <em class="parameter"><code>time_</code></em> is ambiguous. In Toronto, for example,
  95. 01:30 on November 7th 2010 occurred twice (once inside of daylight
  96. savings time and the next, an hour later, outside of daylight savings
  97. time). In this case, the different value of <em class="parameter"><code>type</code></em> would result in a
  98. different interval being returned.
  99. </p>
  100. <p>It is still possible for this function to fail. In Toronto, for
  101. example, 02:00 on March 14th 2010 does not exist (due to the leap
  102. forward to begin daylight savings time). -1 is returned in that
  103. case.</p>
  104. <div class="refsect3">
  105. <a name="id-1.1.70.3.3.7"></a><h4>Parameters</h4>
  106. <div class="informaltable"><table>
  107. <tr>
  108. <td class="parameter_name"><p>tz</p></td>
  109. <td class="parameter_description">
  110. <p>a <span class="type">GTimeZone</span></p>
  111. <p>Passed as <code class="code">self</code></p>
  112. </td>
  113. </tr>
  114. <tr>
  115. <td class="parameter_name"><p>type</p></td>
  116. <td class="parameter_description">
  117. <p>the <span class="type">GTimeType</span> of <em class="parameter"><code>time_</code></em></p>
  118. <p>Passed as <code class="code">type</code></p>
  119. </td>
  120. </tr>
  121. <tr>
  122. <td class="parameter_name"><p>time_</p></td>
  123. <td class="parameter_description">
  124. <p>a number of seconds since January 1, 1970</p>
  125. <p>Passed as <code class="code">time-</code></p>
  126. </td>
  127. </tr>
  128. </table></div>
  129. </div>
  130. </div>
  131. <div class="refsect2">
  132. <a name="id-1.1.70.3.4"></a><h3>get-abbreviation</h3>
  133. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:get-abbreviation self interval))
  134. </pre></div>
  135. <p>Determines the time zone abbreviation to be used during a particular
  136. <em class="parameter"><code>interval</code></em> of time in the time zone <em class="parameter"><code>tz</code></em>.
  137. </p>
  138. <p>For example, in Toronto this is currently "EST" during the winter
  139. months and "EDT" during the summer months when daylight savings time
  140. is in effect.</p>
  141. <div class="refsect3">
  142. <a name="id-1.1.70.3.4.5"></a><h4>Parameters</h4>
  143. <div class="informaltable"><table>
  144. <tr>
  145. <td class="parameter_name"><p>tz</p></td>
  146. <td class="parameter_description">
  147. <p>a <span class="type">GTimeZone</span></p>
  148. <p>Passed as <code class="code">self</code></p>
  149. </td>
  150. </tr>
  151. <tr>
  152. <td class="parameter_name"><p>interval</p></td>
  153. <td class="parameter_description">
  154. <p>an interval within the timezone</p>
  155. <p>Passed as <code class="code">interval</code></p>
  156. </td>
  157. </tr>
  158. </table></div>
  159. </div>
  160. </div>
  161. <div class="refsect2">
  162. <a name="id-1.1.70.3.5"></a><h3>get-identifier</h3>
  163. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:get-identifier self))
  164. </pre></div>
  165. <p>Get the identifier of this <span class="type">GTimeZone</span>, as passed to <code class="function">g_time_zone_new()</code>.
  166. If the identifier passed at construction time was not recognised, <code class="code">UTC</code> will
  167. be returned. If it was <code class="constant">NULL</code>, the identifier of the local timezone at
  168. construction time will be returned.
  169. </p>
  170. <p>The identifier will be returned in the same format as provided at
  171. construction time: if provided as a time offset, that will be returned by
  172. this function.</p>
  173. <div class="refsect3">
  174. <a name="id-1.1.70.3.5.5"></a><h4>Parameters</h4>
  175. <div class="informaltable"><table><tr>
  176. <td class="parameter_name"><p>tz</p></td>
  177. <td class="parameter_description">
  178. <p>a <span class="type">GTimeZone</span></p>
  179. <p>Passed as <code class="code">self</code></p>
  180. </td>
  181. </tr></table></div>
  182. </div>
  183. </div>
  184. <div class="refsect2">
  185. <a name="id-1.1.70.3.6"></a><h3>get-offset</h3>
  186. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:get-offset self interval))
  187. </pre></div>
  188. <p>Determines the offset to UTC in effect during a particular <em class="parameter"><code>interval</code></em>
  189. of time in the time zone <em class="parameter"><code>tz</code></em>.
  190. </p>
  191. <p>The offset is the number of seconds that you add to UTC time to
  192. arrive at local time for <em class="parameter"><code>tz</code></em> (ie: negative numbers for time zones
  193. west of GMT, positive numbers for east).</p>
  194. <div class="refsect3">
  195. <a name="id-1.1.70.3.6.5"></a><h4>Parameters</h4>
  196. <div class="informaltable"><table>
  197. <tr>
  198. <td class="parameter_name"><p>tz</p></td>
  199. <td class="parameter_description">
  200. <p>a <span class="type">GTimeZone</span></p>
  201. <p>Passed as <code class="code">self</code></p>
  202. </td>
  203. </tr>
  204. <tr>
  205. <td class="parameter_name"><p>interval</p></td>
  206. <td class="parameter_description">
  207. <p>an interval within the timezone</p>
  208. <p>Passed as <code class="code">interval</code></p>
  209. </td>
  210. </tr>
  211. </table></div>
  212. </div>
  213. </div>
  214. <div class="refsect2">
  215. <a name="id-1.1.70.3.7"></a><h3>is-dst?</h3>
  216. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:is-dst? self interval))
  217. </pre></div>
  218. <p>Determines if daylight savings time is in effect during a particular
  219. <em class="parameter"><code>interval</code></em> of time in the time zone <em class="parameter"><code>tz</code></em>.</p>
  220. <div class="refsect3">
  221. <a name="id-1.1.70.3.7.4"></a><h4>Parameters</h4>
  222. <div class="informaltable"><table>
  223. <tr>
  224. <td class="parameter_name"><p>tz</p></td>
  225. <td class="parameter_description">
  226. <p>a <span class="type">GTimeZone</span></p>
  227. <p>Passed as <code class="code">self</code></p>
  228. </td>
  229. </tr>
  230. <tr>
  231. <td class="parameter_name"><p>interval</p></td>
  232. <td class="parameter_description">
  233. <p>an interval within the timezone</p>
  234. <p>Passed as <code class="code">interval</code></p>
  235. </td>
  236. </tr>
  237. </table></div>
  238. </div>
  239. </div>
  240. <div class="refsect2">
  241. <a name="id-1.1.70.3.8"></a><h3>ref</h3>
  242. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:ref self))
  243. </pre></div>
  244. <p>Increases the reference count on <em class="parameter"><code>tz</code></em>.</p>
  245. <div class="refsect3">
  246. <a name="id-1.1.70.3.8.4"></a><h4>Parameters</h4>
  247. <div class="informaltable"><table><tr>
  248. <td class="parameter_name"><p>tz</p></td>
  249. <td class="parameter_description">
  250. <p>a <span class="type">GTimeZone</span></p>
  251. <p>Passed as <code class="code">self</code></p>
  252. </td>
  253. </tr></table></div>
  254. </div>
  255. </div>
  256. <div class="refsect2">
  257. <a name="id-1.1.70.3.9"></a><h3>unref</h3>
  258. <div class="informalexample"><pre class="programlisting">(define-values () (time-zone:unref self))
  259. </pre></div>
  260. <p>Decreases the reference count on <em class="parameter"><code>tz</code></em>.</p>
  261. <div class="refsect3">
  262. <a name="id-1.1.70.3.9.4"></a><h4>Parameters</h4>
  263. <div class="informaltable"><table><tr>
  264. <td class="parameter_name"><p>tz</p></td>
  265. <td class="parameter_description">
  266. <p>a <span class="type">GTimeZone</span></p>
  267. <p>Passed as <code class="code">self</code></p>
  268. </td>
  269. </tr></table></div>
  270. </div>
  271. </div>
  272. <div class="refsect2">
  273. <a name="id-1.1.70.3.10"></a><h3>time-zone:new-utc</h3>
  274. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-utc))
  275. </pre></div>
  276. <p>Undocumented</p>
  277. </div>
  278. <div class="refsect2">
  279. <a name="id-1.1.70.3.11"></a><h3>time-zone:new-offset</h3>
  280. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-offset seconds))
  281. </pre></div>
  282. <p>Undocumented</p>
  283. <div class="refsect3">
  284. <a name="id-1.1.70.3.11.4"></a><h4>Parameters</h4>
  285. <div class="informaltable"><table><tr>
  286. <td class="parameter_name"><p>seconds</p></td>
  287. <td class="parameter_description">
  288. <p></p>
  289. <p>Passed as <code class="code">seconds</code></p>
  290. </td>
  291. </tr></table></div>
  292. </div>
  293. </div>
  294. <div class="refsect2">
  295. <a name="id-1.1.70.3.12"></a><h3>time-zone:new-local</h3>
  296. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-local))
  297. </pre></div>
  298. <p>Undocumented</p>
  299. </div>
  300. <div class="refsect2">
  301. <a name="id-1.1.70.3.13"></a><h3>time-zone:new-identifier</h3>
  302. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-identifier identifier))
  303. </pre></div>
  304. <p>Undocumented</p>
  305. <div class="refsect3">
  306. <a name="id-1.1.70.3.13.4"></a><h4>Parameters</h4>
  307. <div class="informaltable"><table><tr>
  308. <td class="parameter_name"><p>identifier</p></td>
  309. <td class="parameter_description">
  310. <p></p>
  311. <p>Passed as <code class="code">identifier</code></p>
  312. </td>
  313. </tr></table></div>
  314. </div>
  315. </div>
  316. <div class="refsect2">
  317. <a name="id-1.1.70.3.14"></a><h3>time-zone:new</h3>
  318. <div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new identifier))
  319. </pre></div>
  320. <p>Undocumented</p>
  321. <div class="refsect3">
  322. <a name="id-1.1.70.3.14.4"></a><h4>Parameters</h4>
  323. <div class="informaltable"><table><tr>
  324. <td class="parameter_name"><p>identifier</p></td>
  325. <td class="parameter_description">
  326. <p></p>
  327. <p>Passed as <code class="code">identifier</code></p>
  328. </td>
  329. </tr></table></div>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. <div class="footer">
  335. <hr>Generated by GTK-Doc V1.33.1</div>
  336. </body>
  337. </html>