re12.html 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298
  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;GDateTime&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="re11.html" title="&lt;%GLibDateMonth&gt;">
  10. <link rel="next" href="re13.html" title="&lt;%GLibDateWeekday&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="re11.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
  20. <td><a accesskey="n" href="re13.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.13"></a><div class="titlepage"></div>
  24. <div class="refnamediv">
  25. <h2>&lt;GDateTime&gt;</h2>
  26. <p>&lt;GDateTime&gt;</p>
  27. </div>
  28. <div class="refsect1">
  29. <a name="id-1.1.13.2"></a><h2>Description</h2>
  30. <p>An opaque structure that represents a date and time, including a time zone.</p>
  31. </div>
  32. <div class="refsect1">
  33. <a name="id-1.1.13.3"></a><h2>Functions</h2>
  34. <div class="refsect2">
  35. <a name="id-1.1.13.3.2"></a><h3>add</h3>
  36. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:add self timespan))
  37. </pre></div>
  38. <p>Creates a copy of <em class="parameter"><code>datetime</code></em> and adds the specified timespan to the copy.</p>
  39. <div class="refsect3">
  40. <a name="id-1.1.13.3.2.4"></a><h4>Parameters</h4>
  41. <div class="informaltable"><table>
  42. <tr>
  43. <td class="parameter_name"><p>datetime</p></td>
  44. <td class="parameter_description">
  45. <p>a <span class="type">GDateTime</span></p>
  46. <p>Passed as <code class="code">self</code></p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="parameter_name"><p>timespan</p></td>
  51. <td class="parameter_description">
  52. <p>a <span class="type">GTimeSpan</span></p>
  53. <p>Passed as <code class="code">timespan</code></p>
  54. </td>
  55. </tr>
  56. </table></div>
  57. </div>
  58. </div>
  59. <div class="refsect2">
  60. <a name="id-1.1.13.3.3"></a><h3>add-days</h3>
  61. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:add-days self days))
  62. </pre></div>
  63. <p>Creates a copy of <em class="parameter"><code>datetime</code></em> and adds the specified number of days to the
  64. copy. Add negative values to subtract days.</p>
  65. <div class="refsect3">
  66. <a name="id-1.1.13.3.3.4"></a><h4>Parameters</h4>
  67. <div class="informaltable"><table>
  68. <tr>
  69. <td class="parameter_name"><p>datetime</p></td>
  70. <td class="parameter_description">
  71. <p>a <span class="type">GDateTime</span></p>
  72. <p>Passed as <code class="code">self</code></p>
  73. </td>
  74. </tr>
  75. <tr>
  76. <td class="parameter_name"><p>days</p></td>
  77. <td class="parameter_description">
  78. <p>the number of days</p>
  79. <p>Passed as <code class="code">days</code></p>
  80. </td>
  81. </tr>
  82. </table></div>
  83. </div>
  84. </div>
  85. <div class="refsect2">
  86. <a name="id-1.1.13.3.4"></a><h3>add-full</h3>
  87. <div class="informalexample"><pre class="programlisting">(define-values
  88. (%return)
  89. (date-time:add-full self years months days hours minutes seconds))
  90. </pre></div>
  91. <p>Creates a new <span class="type">GDateTime</span> adding the specified values to the current date and
  92. time in <em class="parameter"><code>datetime</code></em>. Add negative values to subtract.</p>
  93. <div class="refsect3">
  94. <a name="id-1.1.13.3.4.4"></a><h4>Parameters</h4>
  95. <div class="informaltable"><table>
  96. <tr>
  97. <td class="parameter_name"><p>datetime</p></td>
  98. <td class="parameter_description">
  99. <p>a <span class="type">GDateTime</span></p>
  100. <p>Passed as <code class="code">self</code></p>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td class="parameter_name"><p>years</p></td>
  105. <td class="parameter_description">
  106. <p>the number of years to add</p>
  107. <p>Passed as <code class="code">years</code></p>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td class="parameter_name"><p>months</p></td>
  112. <td class="parameter_description">
  113. <p>the number of months to add</p>
  114. <p>Passed as <code class="code">months</code></p>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td class="parameter_name"><p>days</p></td>
  119. <td class="parameter_description">
  120. <p>the number of days to add</p>
  121. <p>Passed as <code class="code">days</code></p>
  122. </td>
  123. </tr>
  124. <tr>
  125. <td class="parameter_name"><p>hours</p></td>
  126. <td class="parameter_description">
  127. <p>the number of hours to add</p>
  128. <p>Passed as <code class="code">hours</code></p>
  129. </td>
  130. </tr>
  131. <tr>
  132. <td class="parameter_name"><p>minutes</p></td>
  133. <td class="parameter_description">
  134. <p>the number of minutes to add</p>
  135. <p>Passed as <code class="code">minutes</code></p>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td class="parameter_name"><p>seconds</p></td>
  140. <td class="parameter_description">
  141. <p>the number of seconds to add</p>
  142. <p>Passed as <code class="code">seconds</code></p>
  143. </td>
  144. </tr>
  145. </table></div>
  146. </div>
  147. </div>
  148. <div class="refsect2">
  149. <a name="id-1.1.13.3.5"></a><h3>add-hours</h3>
  150. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:add-hours self hours))
  151. </pre></div>
  152. <p>Creates a copy of <em class="parameter"><code>datetime</code></em> and adds the specified number of hours.
  153. Add negative values to subtract hours.</p>
  154. <div class="refsect3">
  155. <a name="id-1.1.13.3.5.4"></a><h4>Parameters</h4>
  156. <div class="informaltable"><table>
  157. <tr>
  158. <td class="parameter_name"><p>datetime</p></td>
  159. <td class="parameter_description">
  160. <p>a <span class="type">GDateTime</span></p>
  161. <p>Passed as <code class="code">self</code></p>
  162. </td>
  163. </tr>
  164. <tr>
  165. <td class="parameter_name"><p>hours</p></td>
  166. <td class="parameter_description">
  167. <p>the number of hours to add</p>
  168. <p>Passed as <code class="code">hours</code></p>
  169. </td>
  170. </tr>
  171. </table></div>
  172. </div>
  173. </div>
  174. <div class="refsect2">
  175. <a name="id-1.1.13.3.6"></a><h3>add-minutes</h3>
  176. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:add-minutes self minutes))
  177. </pre></div>
  178. <p>Creates a copy of <em class="parameter"><code>datetime</code></em> adding the specified number of minutes.
  179. Add negative values to subtract minutes.</p>
  180. <div class="refsect3">
  181. <a name="id-1.1.13.3.6.4"></a><h4>Parameters</h4>
  182. <div class="informaltable"><table>
  183. <tr>
  184. <td class="parameter_name"><p>datetime</p></td>
  185. <td class="parameter_description">
  186. <p>a <span class="type">GDateTime</span></p>
  187. <p>Passed as <code class="code">self</code></p>
  188. </td>
  189. </tr>
  190. <tr>
  191. <td class="parameter_name"><p>minutes</p></td>
  192. <td class="parameter_description">
  193. <p>the number of minutes to add</p>
  194. <p>Passed as <code class="code">minutes</code></p>
  195. </td>
  196. </tr>
  197. </table></div>
  198. </div>
  199. </div>
  200. <div class="refsect2">
  201. <a name="id-1.1.13.3.7"></a><h3>add-months</h3>
  202. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:add-months self months))
  203. </pre></div>
  204. <p>Creates a copy of <em class="parameter"><code>datetime</code></em> and adds the specified number of months to the
  205. copy. Add negative values to subtract months.
  206. </p>
  207. <p>The day of the month of the resulting <span class="type">GDateTime</span> is clamped to the number
  208. of days in the updated calendar month. For example, if adding 1 month to
  209. 31st January 2018, the result would be 28th February 2018. In 2020 (a leap
  210. year), the result would be 29th February.</p>
  211. <div class="refsect3">
  212. <a name="id-1.1.13.3.7.5"></a><h4>Parameters</h4>
  213. <div class="informaltable"><table>
  214. <tr>
  215. <td class="parameter_name"><p>datetime</p></td>
  216. <td class="parameter_description">
  217. <p>a <span class="type">GDateTime</span></p>
  218. <p>Passed as <code class="code">self</code></p>
  219. </td>
  220. </tr>
  221. <tr>
  222. <td class="parameter_name"><p>months</p></td>
  223. <td class="parameter_description">
  224. <p>the number of months</p>
  225. <p>Passed as <code class="code">months</code></p>
  226. </td>
  227. </tr>
  228. </table></div>
  229. </div>
  230. </div>
  231. <div class="refsect2">
  232. <a name="id-1.1.13.3.8"></a><h3>add-seconds</h3>
  233. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:add-seconds self seconds))
  234. </pre></div>
  235. <p>Creates a copy of <em class="parameter"><code>datetime</code></em> and adds the specified number of seconds.
  236. Add negative values to subtract seconds.</p>
  237. <div class="refsect3">
  238. <a name="id-1.1.13.3.8.4"></a><h4>Parameters</h4>
  239. <div class="informaltable"><table>
  240. <tr>
  241. <td class="parameter_name"><p>datetime</p></td>
  242. <td class="parameter_description">
  243. <p>a <span class="type">GDateTime</span></p>
  244. <p>Passed as <code class="code">self</code></p>
  245. </td>
  246. </tr>
  247. <tr>
  248. <td class="parameter_name"><p>seconds</p></td>
  249. <td class="parameter_description">
  250. <p>the number of seconds to add</p>
  251. <p>Passed as <code class="code">seconds</code></p>
  252. </td>
  253. </tr>
  254. </table></div>
  255. </div>
  256. </div>
  257. <div class="refsect2">
  258. <a name="id-1.1.13.3.9"></a><h3>add-weeks</h3>
  259. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:add-weeks self weeks))
  260. </pre></div>
  261. <p>Creates a copy of <em class="parameter"><code>datetime</code></em> and adds the specified number of weeks to the
  262. copy. Add negative values to subtract weeks.</p>
  263. <div class="refsect3">
  264. <a name="id-1.1.13.3.9.4"></a><h4>Parameters</h4>
  265. <div class="informaltable"><table>
  266. <tr>
  267. <td class="parameter_name"><p>datetime</p></td>
  268. <td class="parameter_description">
  269. <p>a <span class="type">GDateTime</span></p>
  270. <p>Passed as <code class="code">self</code></p>
  271. </td>
  272. </tr>
  273. <tr>
  274. <td class="parameter_name"><p>weeks</p></td>
  275. <td class="parameter_description">
  276. <p>the number of weeks</p>
  277. <p>Passed as <code class="code">weeks</code></p>
  278. </td>
  279. </tr>
  280. </table></div>
  281. </div>
  282. </div>
  283. <div class="refsect2">
  284. <a name="id-1.1.13.3.10"></a><h3>add-years</h3>
  285. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:add-years self years))
  286. </pre></div>
  287. <p>Creates a copy of <em class="parameter"><code>datetime</code></em> and adds the specified number of years to the
  288. copy. Add negative values to subtract years.
  289. </p>
  290. <p>As with <code class="function">g_date_time_add_months()</code>, if the resulting date would be 29th
  291. February on a non-leap year, the day will be clamped to 28th February.</p>
  292. <div class="refsect3">
  293. <a name="id-1.1.13.3.10.5"></a><h4>Parameters</h4>
  294. <div class="informaltable"><table>
  295. <tr>
  296. <td class="parameter_name"><p>datetime</p></td>
  297. <td class="parameter_description">
  298. <p>a <span class="type">GDateTime</span></p>
  299. <p>Passed as <code class="code">self</code></p>
  300. </td>
  301. </tr>
  302. <tr>
  303. <td class="parameter_name"><p>years</p></td>
  304. <td class="parameter_description">
  305. <p>the number of years</p>
  306. <p>Passed as <code class="code">years</code></p>
  307. </td>
  308. </tr>
  309. </table></div>
  310. </div>
  311. </div>
  312. <div class="refsect2">
  313. <a name="id-1.1.13.3.11"></a><h3>difference</h3>
  314. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:difference self begin))
  315. </pre></div>
  316. <p>Calculates the difference in time between <em class="parameter"><code>end</code></em> and <em class="parameter"><code>begin</code></em>. The
  317. <span class="type">GTimeSpan</span> that is returned is effectively <em class="parameter"><code>end</code></em> - <em class="parameter"><code>begin</code></em> (ie:
  318. positive if the first parameter is larger).</p>
  319. <div class="refsect3">
  320. <a name="id-1.1.13.3.11.4"></a><h4>Parameters</h4>
  321. <div class="informaltable"><table>
  322. <tr>
  323. <td class="parameter_name"><p>end</p></td>
  324. <td class="parameter_description">
  325. <p>a <span class="type">GDateTime</span></p>
  326. <p>Passed as <code class="code">self</code></p>
  327. </td>
  328. </tr>
  329. <tr>
  330. <td class="parameter_name"><p>begin</p></td>
  331. <td class="parameter_description">
  332. <p>a <span class="type">GDateTime</span></p>
  333. <p>Passed as <code class="code">begin</code></p>
  334. </td>
  335. </tr>
  336. </table></div>
  337. </div>
  338. </div>
  339. <div class="refsect2">
  340. <a name="id-1.1.13.3.12"></a><h3>format</h3>
  341. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:format self format))
  342. </pre></div>
  343. <p>Creates a newly allocated string representing the requested <em class="parameter"><code>format</code></em>.
  344. </p>
  345. <p>The format strings understood by this function are a subset of the
  346. <code class="function">strftime()</code> format language as specified by C99. The \%D, \%U and \%W
  347. conversions are not supported, nor is the 'E' modifier. The GNU
  348. extensions \%k, \%l, \%s and \%P are supported, however, as are the
  349. '0', '_' and '-' modifiers. The Python extension \%f is also supported.
  350. </p>
  351. <p>In contrast to <code class="function">strftime()</code>, this function always produces a UTF-8
  352. string, regardless of the current locale. Note that the rendering of
  353. many formats is locale-dependent and may not match the <code class="function">strftime()</code>
  354. output exactly.
  355. </p>
  356. <p>The following format specifiers are supported:
  357. </p>
  358. <p>- \%a: the abbreviated weekday name according to the current locale
  359. - \%A: the full weekday name according to the current locale
  360. - \%b: the abbreviated month name according to the current locale
  361. - \%B: the full month name according to the current locale
  362. - \%c: the preferred date and time representation for the current locale
  363. - \%C: the century number (year/100) as a 2-digit integer (00-99)
  364. - \%d: the day of the month as a decimal number (range 01 to 31)
  365. - \%e: the day of the month as a decimal number (range 1 to 31)
  366. - \%F: equivalent to <code class="code">%Y-%m-%d</code> (the ISO 8601 date format)
  367. - \%g: the last two digits of the ISO 8601 week-based year as a
  368. decimal number (00-99). This works well with \%V and \%u.
  369. - \%G: the ISO 8601 week-based year as a decimal number. This works
  370. well with \%V and \%u.
  371. - \%h: equivalent to \%b
  372. - \%H: the hour as a decimal number using a 24-hour clock (range 00 to 23)
  373. - \%I: the hour as a decimal number using a 12-hour clock (range 01 to 12)
  374. - \%j: the day of the year as a decimal number (range 001 to 366)
  375. - \%k: the hour (24-hour clock) as a decimal number (range 0 to 23);
  376. single digits are preceded by a blank
  377. - \%l: the hour (12-hour clock) as a decimal number (range 1 to 12);
  378. single digits are preceded by a blank
  379. - \%m: the month as a decimal number (range 01 to 12)
  380. - \%M: the minute as a decimal number (range 00 to 59)
  381. - \%f: the microsecond as a decimal number (range 000000 to 999999)
  382. - \%p: either "AM" or "PM" according to the given time value, or the
  383. corresponding strings for the current locale. Noon is treated as
  384. "PM" and midnight as "AM". Use of this format specifier is discouraged, as
  385. many locales have no concept of AM/PM formatting. Use \%c or \%X instead.
  386. - \%P: like \%p but lowercase: "am" or "pm" or a corresponding string for
  387. the current locale. Use of this format specifier is discouraged, as
  388. many locales have no concept of AM/PM formatting. Use \%c or \%X instead.
  389. - \%r: the time in a.m. or p.m. notation. Use of this format specifier is
  390. discouraged, as many locales have no concept of AM/PM formatting. Use \%c
  391. or \%X instead.
  392. - \%R: the time in 24-hour notation (\%H:\%M)
  393. - \%s: the number of seconds since the Epoch, that is, since 1970-01-01
  394. 00:00:00 UTC
  395. - \%S: the second as a decimal number (range 00 to 60)
  396. - \%t: a tab character
  397. - \%T: the time in 24-hour notation with seconds (\%H:\%M:\%S)
  398. - \%u: the ISO 8601 standard day of the week as a decimal, range 1 to 7,
  399. Monday being 1. This works well with \%G and \%V.
  400. - \%V: the ISO 8601 standard week number of the current year as a decimal
  401. number, range 01 to 53, where week 1 is the first week that has at
  402. least 4 days in the new year. See <code class="function">g_date_time_get_week_of_year()</code>.
  403. This works well with \%G and \%u.
  404. - \%w: the day of the week as a decimal, range 0 to 6, Sunday being 0.
  405. This is not the ISO 8601 standard format -- use \%u instead.
  406. - \%x: the preferred date representation for the current locale without
  407. the time
  408. - \%X: the preferred time representation for the current locale without
  409. the date
  410. - \%y: the year as a decimal number without the century
  411. - \%Y: the year as a decimal number including the century
  412. - \%z: the time zone as an offset from UTC (+hhmm)
  413. - \%:z: the time zone as an offset from UTC (+hh:mm).
  414. This is a gnulib <code class="function">strftime()</code> extension. Since: 2.38
  415. - \%::z: the time zone as an offset from UTC (+hh:mm:ss). This is a
  416. gnulib <code class="function">strftime()</code> extension. Since: 2.38
  417. - \%:::z: the time zone as an offset from UTC, with : to necessary
  418. precision (e.g., -04, +05:30). This is a gnulib <code class="function">strftime()</code> extension. Since: 2.38
  419. - \%Z: the time zone or name or abbreviation
  420. - \%\%: a literal \% character
  421. </p>
  422. <p>Some conversion specifications can be modified by preceding the
  423. conversion specifier by one or more modifier characters. The
  424. following modifiers are supported for many of the numeric
  425. conversions:
  426. </p>
  427. <p>- O: Use alternative numeric symbols, if the current locale supports those.
  428. - _: Pad a numeric result with spaces. This overrides the default padding
  429. for the specifier.
  430. - -: Do not pad a numeric result. This overrides the default padding
  431. for the specifier.
  432. - 0: Pad a numeric result with zeros. This overrides the default padding
  433. for the specifier.
  434. </p>
  435. <p>Additionally, when O is used with B, b, or h, it produces the alternative
  436. form of a month name. The alternative form should be used when the month
  437. name is used without a day number (e.g., standalone). It is required in
  438. some languages (Baltic, Slavic, Greek, and more) due to their grammatical
  439. rules. For other languages there is no difference. \%OB is a GNU and BSD
  440. <code class="function">strftime()</code> extension expected to be added to the future POSIX specification,
  441. \%Ob and \%Oh are GNU <code class="function">strftime()</code> extensions. Since: 2.56</p>
  442. <div class="refsect3">
  443. <a name="id-1.1.13.3.12.11"></a><h4>Parameters</h4>
  444. <div class="informaltable"><table>
  445. <tr>
  446. <td class="parameter_name"><p>datetime</p></td>
  447. <td class="parameter_description">
  448. <p>A <span class="type">GDateTime</span></p>
  449. <p>Passed as <code class="code">self</code></p>
  450. </td>
  451. </tr>
  452. <tr>
  453. <td class="parameter_name"><p>format</p></td>
  454. <td class="parameter_description">
  455. <p>a valid UTF-8 string, containing the format for the
  456. <span class="type">GDateTime</span></p>
  457. <p>Passed as <code class="code">format</code></p>
  458. </td>
  459. </tr>
  460. </table></div>
  461. </div>
  462. </div>
  463. <div class="refsect2">
  464. <a name="id-1.1.13.3.13"></a><h3>format-iso8601</h3>
  465. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:format-iso8601 self))
  466. </pre></div>
  467. <p>Format <em class="parameter"><code>datetime</code></em> in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601),
  468. including the date, time and time zone, and return that as a UTF-8 encoded
  469. string.
  470. </p>
  471. <p>Since GLib 2.66, this will output to sub-second precision if needed.</p>
  472. <div class="refsect3">
  473. <a name="id-1.1.13.3.13.5"></a><h4>Parameters</h4>
  474. <div class="informaltable"><table><tr>
  475. <td class="parameter_name"><p>datetime</p></td>
  476. <td class="parameter_description">
  477. <p>A <span class="type">GDateTime</span></p>
  478. <p>Passed as <code class="code">self</code></p>
  479. </td>
  480. </tr></table></div>
  481. </div>
  482. </div>
  483. <div class="refsect2">
  484. <a name="id-1.1.13.3.14"></a><h3>get-day-of-month</h3>
  485. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-day-of-month self))
  486. </pre></div>
  487. <p>Retrieves the day of the month represented by <em class="parameter"><code>datetime</code></em> in the gregorian
  488. calendar.</p>
  489. <div class="refsect3">
  490. <a name="id-1.1.13.3.14.4"></a><h4>Parameters</h4>
  491. <div class="informaltable"><table><tr>
  492. <td class="parameter_name"><p>datetime</p></td>
  493. <td class="parameter_description">
  494. <p>a <span class="type">GDateTime</span></p>
  495. <p>Passed as <code class="code">self</code></p>
  496. </td>
  497. </tr></table></div>
  498. </div>
  499. </div>
  500. <div class="refsect2">
  501. <a name="id-1.1.13.3.15"></a><h3>get-day-of-week</h3>
  502. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-day-of-week self))
  503. </pre></div>
  504. <p>Retrieves the ISO 8601 day of the week on which <em class="parameter"><code>datetime</code></em> falls (1 is
  505. Monday, 2 is Tuesday... 7 is Sunday).</p>
  506. <div class="refsect3">
  507. <a name="id-1.1.13.3.15.4"></a><h4>Parameters</h4>
  508. <div class="informaltable"><table><tr>
  509. <td class="parameter_name"><p>datetime</p></td>
  510. <td class="parameter_description">
  511. <p>a <span class="type">GDateTime</span></p>
  512. <p>Passed as <code class="code">self</code></p>
  513. </td>
  514. </tr></table></div>
  515. </div>
  516. </div>
  517. <div class="refsect2">
  518. <a name="id-1.1.13.3.16"></a><h3>get-day-of-year</h3>
  519. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-day-of-year self))
  520. </pre></div>
  521. <p>Retrieves the day of the year represented by <em class="parameter"><code>datetime</code></em> in the Gregorian
  522. calendar.</p>
  523. <div class="refsect3">
  524. <a name="id-1.1.13.3.16.4"></a><h4>Parameters</h4>
  525. <div class="informaltable"><table><tr>
  526. <td class="parameter_name"><p>datetime</p></td>
  527. <td class="parameter_description">
  528. <p>a <span class="type">GDateTime</span></p>
  529. <p>Passed as <code class="code">self</code></p>
  530. </td>
  531. </tr></table></div>
  532. </div>
  533. </div>
  534. <div class="refsect2">
  535. <a name="id-1.1.13.3.17"></a><h3>get-hour</h3>
  536. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-hour self))
  537. </pre></div>
  538. <p>Retrieves the hour of the day represented by <em class="parameter"><code>datetime</code></em></p>
  539. <div class="refsect3">
  540. <a name="id-1.1.13.3.17.4"></a><h4>Parameters</h4>
  541. <div class="informaltable"><table><tr>
  542. <td class="parameter_name"><p>datetime</p></td>
  543. <td class="parameter_description">
  544. <p>a <span class="type">GDateTime</span></p>
  545. <p>Passed as <code class="code">self</code></p>
  546. </td>
  547. </tr></table></div>
  548. </div>
  549. </div>
  550. <div class="refsect2">
  551. <a name="id-1.1.13.3.18"></a><h3>get-microsecond</h3>
  552. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-microsecond self))
  553. </pre></div>
  554. <p>Retrieves the microsecond of the date represented by <em class="parameter"><code>datetime</code></em></p>
  555. <div class="refsect3">
  556. <a name="id-1.1.13.3.18.4"></a><h4>Parameters</h4>
  557. <div class="informaltable"><table><tr>
  558. <td class="parameter_name"><p>datetime</p></td>
  559. <td class="parameter_description">
  560. <p>a <span class="type">GDateTime</span></p>
  561. <p>Passed as <code class="code">self</code></p>
  562. </td>
  563. </tr></table></div>
  564. </div>
  565. </div>
  566. <div class="refsect2">
  567. <a name="id-1.1.13.3.19"></a><h3>get-minute</h3>
  568. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-minute self))
  569. </pre></div>
  570. <p>Retrieves the minute of the hour represented by <em class="parameter"><code>datetime</code></em></p>
  571. <div class="refsect3">
  572. <a name="id-1.1.13.3.19.4"></a><h4>Parameters</h4>
  573. <div class="informaltable"><table><tr>
  574. <td class="parameter_name"><p>datetime</p></td>
  575. <td class="parameter_description">
  576. <p>a <span class="type">GDateTime</span></p>
  577. <p>Passed as <code class="code">self</code></p>
  578. </td>
  579. </tr></table></div>
  580. </div>
  581. </div>
  582. <div class="refsect2">
  583. <a name="id-1.1.13.3.20"></a><h3>get-month</h3>
  584. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-month self))
  585. </pre></div>
  586. <p>Retrieves the month of the year represented by <em class="parameter"><code>datetime</code></em> in the Gregorian
  587. calendar.</p>
  588. <div class="refsect3">
  589. <a name="id-1.1.13.3.20.4"></a><h4>Parameters</h4>
  590. <div class="informaltable"><table><tr>
  591. <td class="parameter_name"><p>datetime</p></td>
  592. <td class="parameter_description">
  593. <p>a <span class="type">GDateTime</span></p>
  594. <p>Passed as <code class="code">self</code></p>
  595. </td>
  596. </tr></table></div>
  597. </div>
  598. </div>
  599. <div class="refsect2">
  600. <a name="id-1.1.13.3.21"></a><h3>get-second</h3>
  601. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-second self))
  602. </pre></div>
  603. <p>Retrieves the second of the minute represented by <em class="parameter"><code>datetime</code></em></p>
  604. <div class="refsect3">
  605. <a name="id-1.1.13.3.21.4"></a><h4>Parameters</h4>
  606. <div class="informaltable"><table><tr>
  607. <td class="parameter_name"><p>datetime</p></td>
  608. <td class="parameter_description">
  609. <p>a <span class="type">GDateTime</span></p>
  610. <p>Passed as <code class="code">self</code></p>
  611. </td>
  612. </tr></table></div>
  613. </div>
  614. </div>
  615. <div class="refsect2">
  616. <a name="id-1.1.13.3.22"></a><h3>get-seconds</h3>
  617. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-seconds self))
  618. </pre></div>
  619. <p>Retrieves the number of seconds since the start of the last minute,
  620. including the fractional part.</p>
  621. <div class="refsect3">
  622. <a name="id-1.1.13.3.22.4"></a><h4>Parameters</h4>
  623. <div class="informaltable"><table><tr>
  624. <td class="parameter_name"><p>datetime</p></td>
  625. <td class="parameter_description">
  626. <p>a <span class="type">GDateTime</span></p>
  627. <p>Passed as <code class="code">self</code></p>
  628. </td>
  629. </tr></table></div>
  630. </div>
  631. </div>
  632. <div class="refsect2">
  633. <a name="id-1.1.13.3.23"></a><h3>get-timezone</h3>
  634. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-timezone self))
  635. </pre></div>
  636. <p>Get the time zone for this <em class="parameter"><code>datetime</code></em>.</p>
  637. <div class="refsect3">
  638. <a name="id-1.1.13.3.23.4"></a><h4>Parameters</h4>
  639. <div class="informaltable"><table><tr>
  640. <td class="parameter_name"><p>datetime</p></td>
  641. <td class="parameter_description">
  642. <p>a <span class="type">GDateTime</span></p>
  643. <p>Passed as <code class="code">self</code></p>
  644. </td>
  645. </tr></table></div>
  646. </div>
  647. </div>
  648. <div class="refsect2">
  649. <a name="id-1.1.13.3.24"></a><h3>get-timezone-abbreviation</h3>
  650. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-timezone-abbreviation self))
  651. </pre></div>
  652. <p>Determines the time zone abbreviation to be used at the time and in
  653. the time zone of <em class="parameter"><code>datetime</code></em>.
  654. </p>
  655. <p>For example, in Toronto this is currently "EST" during the winter
  656. months and "EDT" during the summer months when daylight savings
  657. time is in effect.</p>
  658. <div class="refsect3">
  659. <a name="id-1.1.13.3.24.5"></a><h4>Parameters</h4>
  660. <div class="informaltable"><table><tr>
  661. <td class="parameter_name"><p>datetime</p></td>
  662. <td class="parameter_description">
  663. <p>a <span class="type">GDateTime</span></p>
  664. <p>Passed as <code class="code">self</code></p>
  665. </td>
  666. </tr></table></div>
  667. </div>
  668. </div>
  669. <div class="refsect2">
  670. <a name="id-1.1.13.3.25"></a><h3>get-utc-offset</h3>
  671. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-utc-offset self))
  672. </pre></div>
  673. <p>Determines the offset to UTC in effect at the time and in the time
  674. zone of <em class="parameter"><code>datetime</code></em>.
  675. </p>
  676. <p>The offset is the number of microseconds that you add to UTC time to
  677. arrive at local time for the time zone (ie: negative numbers for time
  678. zones west of GMT, positive numbers for east).
  679. </p>
  680. <p>If <em class="parameter"><code>datetime</code></em> represents UTC time, then the offset is always zero.</p>
  681. <div class="refsect3">
  682. <a name="id-1.1.13.3.25.6"></a><h4>Parameters</h4>
  683. <div class="informaltable"><table><tr>
  684. <td class="parameter_name"><p>datetime</p></td>
  685. <td class="parameter_description">
  686. <p>a <span class="type">GDateTime</span></p>
  687. <p>Passed as <code class="code">self</code></p>
  688. </td>
  689. </tr></table></div>
  690. </div>
  691. </div>
  692. <div class="refsect2">
  693. <a name="id-1.1.13.3.26"></a><h3>get-week-numbering-year</h3>
  694. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-week-numbering-year self))
  695. </pre></div>
  696. <p>Returns the ISO 8601 week-numbering year in which the week containing
  697. <em class="parameter"><code>datetime</code></em> falls.
  698. </p>
  699. <p>This function, taken together with <code class="function">g_date_time_get_week_of_year()</code> and
  700. <code class="function">g_date_time_get_day_of_week()</code> can be used to determine the full ISO
  701. week date on which <em class="parameter"><code>datetime</code></em> falls.
  702. </p>
  703. <p>This is usually equal to the normal Gregorian year (as returned by
  704. <code class="function">g_date_time_get_year()</code>), except as detailed below:
  705. </p>
  706. <p>For Thursday, the week-numbering year is always equal to the usual
  707. calendar year. For other days, the number is such that every day
  708. within a complete week (Monday to Sunday) is contained within the
  709. same week-numbering year.
  710. </p>
  711. <p>For Monday, Tuesday and Wednesday occurring near the end of the year,
  712. this may mean that the week-numbering year is one greater than the
  713. calendar year (so that these days have the same week-numbering year
  714. as the Thursday occurring early in the next year).
  715. </p>
  716. <p>For Friday, Saturday and Sunday occurring near the start of the year,
  717. this may mean that the week-numbering year is one less than the
  718. calendar year (so that these days have the same week-numbering year
  719. as the Thursday occurring late in the previous year).
  720. </p>
  721. <p>An equivalent description is that the week-numbering year is equal to
  722. the calendar year containing the majority of the days in the current
  723. week (Monday to Sunday).
  724. </p>
  725. <p>Note that January 1 0001 in the proleptic Gregorian calendar is a
  726. Monday, so this function never returns 0.</p>
  727. <div class="refsect3">
  728. <a name="id-1.1.13.3.26.11"></a><h4>Parameters</h4>
  729. <div class="informaltable"><table><tr>
  730. <td class="parameter_name"><p>datetime</p></td>
  731. <td class="parameter_description">
  732. <p>a <span class="type">GDateTime</span></p>
  733. <p>Passed as <code class="code">self</code></p>
  734. </td>
  735. </tr></table></div>
  736. </div>
  737. </div>
  738. <div class="refsect2">
  739. <a name="id-1.1.13.3.27"></a><h3>get-week-of-year</h3>
  740. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-week-of-year self))
  741. </pre></div>
  742. <p>Returns the ISO 8601 week number for the week containing <em class="parameter"><code>datetime</code></em>.
  743. The ISO 8601 week number is the same for every day of the week (from
  744. Moday through Sunday). That can produce some unusual results
  745. (described below).
  746. </p>
  747. <p>The first week of the year is week 1. This is the week that contains
  748. the first Thursday of the year. Equivalently, this is the first week
  749. that has more than 4 of its days falling within the calendar year.
  750. </p>
  751. <p>The value 0 is never returned by this function. Days contained
  752. within a year but occurring before the first ISO 8601 week of that
  753. year are considered as being contained in the last week of the
  754. previous year. Similarly, the final days of a calendar year may be
  755. considered as being part of the first ISO 8601 week of the next year
  756. if 4 or more days of that week are contained within the new year.</p>
  757. <div class="refsect3">
  758. <a name="id-1.1.13.3.27.6"></a><h4>Parameters</h4>
  759. <div class="informaltable"><table><tr>
  760. <td class="parameter_name"><p>datetime</p></td>
  761. <td class="parameter_description">
  762. <p>a <span class="type">GDateTime</span></p>
  763. <p>Passed as <code class="code">self</code></p>
  764. </td>
  765. </tr></table></div>
  766. </div>
  767. </div>
  768. <div class="refsect2">
  769. <a name="id-1.1.13.3.28"></a><h3>get-year</h3>
  770. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:get-year self))
  771. </pre></div>
  772. <p>Retrieves the year represented by <em class="parameter"><code>datetime</code></em> in the Gregorian calendar.</p>
  773. <div class="refsect3">
  774. <a name="id-1.1.13.3.28.4"></a><h4>Parameters</h4>
  775. <div class="informaltable"><table><tr>
  776. <td class="parameter_name"><p>datetime</p></td>
  777. <td class="parameter_description">
  778. <p>A <span class="type">GDateTime</span></p>
  779. <p>Passed as <code class="code">self</code></p>
  780. </td>
  781. </tr></table></div>
  782. </div>
  783. </div>
  784. <div class="refsect2">
  785. <a name="id-1.1.13.3.29"></a><h3>get-ymd</h3>
  786. <div class="informalexample"><pre class="programlisting">(define-values (year month day) (date-time:get-ymd self))
  787. </pre></div>
  788. <p>Retrieves the Gregorian day, month, and year of a given <span class="type">GDateTime</span>.</p>
  789. <div class="refsect3">
  790. <a name="id-1.1.13.3.29.4"></a><h4>Parameters</h4>
  791. <div class="informaltable"><table>
  792. <tr>
  793. <td class="parameter_name"><p>datetime</p></td>
  794. <td class="parameter_description">
  795. <p>a <span class="type">GDateTime</span>.</p>
  796. <p>Passed as <code class="code">self</code></p>
  797. </td>
  798. </tr>
  799. <tr>
  800. <td class="parameter_name"><p>year</p></td>
  801. <td class="parameter_description">
  802. <p>the return location for the gregorian year, or <code class="constant">NULL</code>.</p>
  803. <p>Passed as <code class="code">year</code></p>
  804. </td>
  805. </tr>
  806. <tr>
  807. <td class="parameter_name"><p>month</p></td>
  808. <td class="parameter_description">
  809. <p>the return location for the month of the year, or <code class="constant">NULL</code>.</p>
  810. <p>Passed as <code class="code">month</code></p>
  811. </td>
  812. </tr>
  813. <tr>
  814. <td class="parameter_name"><p>day</p></td>
  815. <td class="parameter_description">
  816. <p>the return location for the day of the month, or <code class="constant">NULL</code>.</p>
  817. <p>Passed as <code class="code">day</code></p>
  818. </td>
  819. </tr>
  820. </table></div>
  821. </div>
  822. </div>
  823. <div class="refsect2">
  824. <a name="id-1.1.13.3.30"></a><h3>is-daylight-savings?</h3>
  825. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:is-daylight-savings? self))
  826. </pre></div>
  827. <p>Determines if daylight savings time is in effect at the time and in
  828. the time zone of <em class="parameter"><code>datetime</code></em>.</p>
  829. <div class="refsect3">
  830. <a name="id-1.1.13.3.30.4"></a><h4>Parameters</h4>
  831. <div class="informaltable"><table><tr>
  832. <td class="parameter_name"><p>datetime</p></td>
  833. <td class="parameter_description">
  834. <p>a <span class="type">GDateTime</span></p>
  835. <p>Passed as <code class="code">self</code></p>
  836. </td>
  837. </tr></table></div>
  838. </div>
  839. </div>
  840. <div class="refsect2">
  841. <a name="id-1.1.13.3.31"></a><h3>ref</h3>
  842. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:ref self))
  843. </pre></div>
  844. <p>Atomically increments the reference count of <em class="parameter"><code>datetime</code></em> by one.</p>
  845. <div class="refsect3">
  846. <a name="id-1.1.13.3.31.4"></a><h4>Parameters</h4>
  847. <div class="informaltable"><table><tr>
  848. <td class="parameter_name"><p>datetime</p></td>
  849. <td class="parameter_description">
  850. <p>a <span class="type">GDateTime</span></p>
  851. <p>Passed as <code class="code">self</code></p>
  852. </td>
  853. </tr></table></div>
  854. </div>
  855. </div>
  856. <div class="refsect2">
  857. <a name="id-1.1.13.3.32"></a><h3>to-local</h3>
  858. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:to-local self))
  859. </pre></div>
  860. <p>Creates a new <span class="type">GDateTime</span> corresponding to the same instant in time as
  861. <em class="parameter"><code>datetime</code></em>, but in the local time zone.
  862. </p>
  863. <p>This call is equivalent to calling <code class="function">g_date_time_to_timezone()</code> with the
  864. time zone returned by <code class="function">g_time_zone_new_local()</code>.</p>
  865. <div class="refsect3">
  866. <a name="id-1.1.13.3.32.5"></a><h4>Parameters</h4>
  867. <div class="informaltable"><table><tr>
  868. <td class="parameter_name"><p>datetime</p></td>
  869. <td class="parameter_description">
  870. <p>a <span class="type">GDateTime</span></p>
  871. <p>Passed as <code class="code">self</code></p>
  872. </td>
  873. </tr></table></div>
  874. </div>
  875. </div>
  876. <div class="refsect2">
  877. <a name="id-1.1.13.3.33"></a><h3>to-timezone</h3>
  878. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:to-timezone self tz))
  879. </pre></div>
  880. <p>Create a new <span class="type">GDateTime</span> corresponding to the same instant in time as
  881. <em class="parameter"><code>datetime</code></em>, but in the time zone <em class="parameter"><code>tz</code></em>.
  882. </p>
  883. <p>This call can fail in the case that the time goes out of bounds. For
  884. example, converting 0001-01-01 00:00:00 UTC to a time zone west of
  885. Greenwich will fail (due to the year 0 being out of range).</p>
  886. <div class="refsect3">
  887. <a name="id-1.1.13.3.33.5"></a><h4>Parameters</h4>
  888. <div class="informaltable"><table>
  889. <tr>
  890. <td class="parameter_name"><p>datetime</p></td>
  891. <td class="parameter_description">
  892. <p>a <span class="type">GDateTime</span></p>
  893. <p>Passed as <code class="code">self</code></p>
  894. </td>
  895. </tr>
  896. <tr>
  897. <td class="parameter_name"><p>tz</p></td>
  898. <td class="parameter_description">
  899. <p>the new <span class="type">GTimeZone</span></p>
  900. <p>Passed as <code class="code">tz</code></p>
  901. </td>
  902. </tr>
  903. </table></div>
  904. </div>
  905. </div>
  906. <div class="refsect2">
  907. <a name="id-1.1.13.3.34"></a><h3>to-unix</h3>
  908. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:to-unix self))
  909. </pre></div>
  910. <p>Gives the Unix time corresponding to <em class="parameter"><code>datetime</code></em>, rounding down to the
  911. nearest second.
  912. </p>
  913. <p>Unix time is the number of seconds that have elapsed since 1970-01-01
  914. 00:00:00 UTC, regardless of the time zone associated with <em class="parameter"><code>datetime</code></em>.</p>
  915. <div class="refsect3">
  916. <a name="id-1.1.13.3.34.5"></a><h4>Parameters</h4>
  917. <div class="informaltable"><table><tr>
  918. <td class="parameter_name"><p>datetime</p></td>
  919. <td class="parameter_description">
  920. <p>a <span class="type">GDateTime</span></p>
  921. <p>Passed as <code class="code">self</code></p>
  922. </td>
  923. </tr></table></div>
  924. </div>
  925. </div>
  926. <div class="refsect2">
  927. <a name="id-1.1.13.3.35"></a><h3>to-utc</h3>
  928. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:to-utc self))
  929. </pre></div>
  930. <p>Creates a new <span class="type">GDateTime</span> corresponding to the same instant in time as
  931. <em class="parameter"><code>datetime</code></em>, but in UTC.
  932. </p>
  933. <p>This call is equivalent to calling <code class="function">g_date_time_to_timezone()</code> with the
  934. time zone returned by <code class="function">g_time_zone_new_utc()</code>.</p>
  935. <div class="refsect3">
  936. <a name="id-1.1.13.3.35.5"></a><h4>Parameters</h4>
  937. <div class="informaltable"><table><tr>
  938. <td class="parameter_name"><p>datetime</p></td>
  939. <td class="parameter_description">
  940. <p>a <span class="type">GDateTime</span></p>
  941. <p>Passed as <code class="code">self</code></p>
  942. </td>
  943. </tr></table></div>
  944. </div>
  945. </div>
  946. <div class="refsect2">
  947. <a name="id-1.1.13.3.36"></a><h3>unref</h3>
  948. <div class="informalexample"><pre class="programlisting">(define-values () (date-time:unref self))
  949. </pre></div>
  950. <p>Atomically decrements the reference count of <em class="parameter"><code>datetime</code></em> by one.
  951. </p>
  952. <p>When the reference count reaches zero, the resources allocated by
  953. <em class="parameter"><code>datetime</code></em> are freed</p>
  954. <div class="refsect3">
  955. <a name="id-1.1.13.3.36.5"></a><h4>Parameters</h4>
  956. <div class="informaltable"><table><tr>
  957. <td class="parameter_name"><p>datetime</p></td>
  958. <td class="parameter_description">
  959. <p>a <span class="type">GDateTime</span></p>
  960. <p>Passed as <code class="code">self</code></p>
  961. </td>
  962. </tr></table></div>
  963. </div>
  964. </div>
  965. <div class="refsect2">
  966. <a name="id-1.1.13.3.37"></a><h3>date-time:new-utc</h3>
  967. <div class="informalexample"><pre class="programlisting">(define-values
  968. (%return)
  969. (date-time:new-utc year month day hour minute seconds))
  970. </pre></div>
  971. <p>Undocumented</p>
  972. <div class="refsect3">
  973. <a name="id-1.1.13.3.37.4"></a><h4>Parameters</h4>
  974. <div class="informaltable"><table>
  975. <tr>
  976. <td class="parameter_name"><p>year</p></td>
  977. <td class="parameter_description">
  978. <p></p>
  979. <p>Passed as <code class="code">year</code></p>
  980. </td>
  981. </tr>
  982. <tr>
  983. <td class="parameter_name"><p>month</p></td>
  984. <td class="parameter_description">
  985. <p></p>
  986. <p>Passed as <code class="code">month</code></p>
  987. </td>
  988. </tr>
  989. <tr>
  990. <td class="parameter_name"><p>day</p></td>
  991. <td class="parameter_description">
  992. <p></p>
  993. <p>Passed as <code class="code">day</code></p>
  994. </td>
  995. </tr>
  996. <tr>
  997. <td class="parameter_name"><p>hour</p></td>
  998. <td class="parameter_description">
  999. <p></p>
  1000. <p>Passed as <code class="code">hour</code></p>
  1001. </td>
  1002. </tr>
  1003. <tr>
  1004. <td class="parameter_name"><p>minute</p></td>
  1005. <td class="parameter_description">
  1006. <p></p>
  1007. <p>Passed as <code class="code">minute</code></p>
  1008. </td>
  1009. </tr>
  1010. <tr>
  1011. <td class="parameter_name"><p>seconds</p></td>
  1012. <td class="parameter_description">
  1013. <p></p>
  1014. <p>Passed as <code class="code">seconds</code></p>
  1015. </td>
  1016. </tr>
  1017. </table></div>
  1018. </div>
  1019. </div>
  1020. <div class="refsect2">
  1021. <a name="id-1.1.13.3.38"></a><h3>date-time:new-now-utc</h3>
  1022. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:new-now-utc))
  1023. </pre></div>
  1024. <p>Undocumented</p>
  1025. </div>
  1026. <div class="refsect2">
  1027. <a name="id-1.1.13.3.39"></a><h3>date-time:new-now-local</h3>
  1028. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:new-now-local))
  1029. </pre></div>
  1030. <p>Undocumented</p>
  1031. </div>
  1032. <div class="refsect2">
  1033. <a name="id-1.1.13.3.40"></a><h3>date-time:new-now</h3>
  1034. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:new-now tz))
  1035. </pre></div>
  1036. <p>Undocumented</p>
  1037. <div class="refsect3">
  1038. <a name="id-1.1.13.3.40.4"></a><h4>Parameters</h4>
  1039. <div class="informaltable"><table><tr>
  1040. <td class="parameter_name"><p>tz</p></td>
  1041. <td class="parameter_description">
  1042. <p></p>
  1043. <p>Passed as <code class="code">tz</code></p>
  1044. </td>
  1045. </tr></table></div>
  1046. </div>
  1047. </div>
  1048. <div class="refsect2">
  1049. <a name="id-1.1.13.3.41"></a><h3>date-time:new-local</h3>
  1050. <div class="informalexample"><pre class="programlisting">(define-values
  1051. (%return)
  1052. (date-time:new-local year month day hour minute seconds))
  1053. </pre></div>
  1054. <p>Undocumented</p>
  1055. <div class="refsect3">
  1056. <a name="id-1.1.13.3.41.4"></a><h4>Parameters</h4>
  1057. <div class="informaltable"><table>
  1058. <tr>
  1059. <td class="parameter_name"><p>year</p></td>
  1060. <td class="parameter_description">
  1061. <p></p>
  1062. <p>Passed as <code class="code">year</code></p>
  1063. </td>
  1064. </tr>
  1065. <tr>
  1066. <td class="parameter_name"><p>month</p></td>
  1067. <td class="parameter_description">
  1068. <p></p>
  1069. <p>Passed as <code class="code">month</code></p>
  1070. </td>
  1071. </tr>
  1072. <tr>
  1073. <td class="parameter_name"><p>day</p></td>
  1074. <td class="parameter_description">
  1075. <p></p>
  1076. <p>Passed as <code class="code">day</code></p>
  1077. </td>
  1078. </tr>
  1079. <tr>
  1080. <td class="parameter_name"><p>hour</p></td>
  1081. <td class="parameter_description">
  1082. <p></p>
  1083. <p>Passed as <code class="code">hour</code></p>
  1084. </td>
  1085. </tr>
  1086. <tr>
  1087. <td class="parameter_name"><p>minute</p></td>
  1088. <td class="parameter_description">
  1089. <p></p>
  1090. <p>Passed as <code class="code">minute</code></p>
  1091. </td>
  1092. </tr>
  1093. <tr>
  1094. <td class="parameter_name"><p>seconds</p></td>
  1095. <td class="parameter_description">
  1096. <p></p>
  1097. <p>Passed as <code class="code">seconds</code></p>
  1098. </td>
  1099. </tr>
  1100. </table></div>
  1101. </div>
  1102. </div>
  1103. <div class="refsect2">
  1104. <a name="id-1.1.13.3.42"></a><h3>date-time:new-from-unix-utc</h3>
  1105. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:new-from-unix-utc t))
  1106. </pre></div>
  1107. <p>Undocumented</p>
  1108. <div class="refsect3">
  1109. <a name="id-1.1.13.3.42.4"></a><h4>Parameters</h4>
  1110. <div class="informaltable"><table><tr>
  1111. <td class="parameter_name"><p>t</p></td>
  1112. <td class="parameter_description">
  1113. <p></p>
  1114. <p>Passed as <code class="code">t</code></p>
  1115. </td>
  1116. </tr></table></div>
  1117. </div>
  1118. </div>
  1119. <div class="refsect2">
  1120. <a name="id-1.1.13.3.43"></a><h3>date-time:new-from-unix-local</h3>
  1121. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:new-from-unix-local t))
  1122. </pre></div>
  1123. <p>Undocumented</p>
  1124. <div class="refsect3">
  1125. <a name="id-1.1.13.3.43.4"></a><h4>Parameters</h4>
  1126. <div class="informaltable"><table><tr>
  1127. <td class="parameter_name"><p>t</p></td>
  1128. <td class="parameter_description">
  1129. <p></p>
  1130. <p>Passed as <code class="code">t</code></p>
  1131. </td>
  1132. </tr></table></div>
  1133. </div>
  1134. </div>
  1135. <div class="refsect2">
  1136. <a name="id-1.1.13.3.44"></a><h3>date-time:new-from-iso8601</h3>
  1137. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:new-from-iso8601 text default-tz))
  1138. </pre></div>
  1139. <p>Undocumented</p>
  1140. <div class="refsect3">
  1141. <a name="id-1.1.13.3.44.4"></a><h4>Parameters</h4>
  1142. <div class="informaltable"><table>
  1143. <tr>
  1144. <td class="parameter_name"><p>text</p></td>
  1145. <td class="parameter_description">
  1146. <p></p>
  1147. <p>Passed as <code class="code">text</code></p>
  1148. </td>
  1149. </tr>
  1150. <tr>
  1151. <td class="parameter_name"><p>default_tz</p></td>
  1152. <td class="parameter_description">
  1153. <p></p>
  1154. <p>Passed as <code class="code">default-tz</code></p>
  1155. </td>
  1156. </tr>
  1157. </table></div>
  1158. </div>
  1159. </div>
  1160. <div class="refsect2">
  1161. <a name="id-1.1.13.3.45"></a><h3>date-time:new</h3>
  1162. <div class="informalexample"><pre class="programlisting">(define-values
  1163. (%return)
  1164. (date-time:new tz year month day hour minute seconds))
  1165. </pre></div>
  1166. <p>Undocumented</p>
  1167. <div class="refsect3">
  1168. <a name="id-1.1.13.3.45.4"></a><h4>Parameters</h4>
  1169. <div class="informaltable"><table>
  1170. <tr>
  1171. <td class="parameter_name"><p>tz</p></td>
  1172. <td class="parameter_description">
  1173. <p></p>
  1174. <p>Passed as <code class="code">tz</code></p>
  1175. </td>
  1176. </tr>
  1177. <tr>
  1178. <td class="parameter_name"><p>year</p></td>
  1179. <td class="parameter_description">
  1180. <p></p>
  1181. <p>Passed as <code class="code">year</code></p>
  1182. </td>
  1183. </tr>
  1184. <tr>
  1185. <td class="parameter_name"><p>month</p></td>
  1186. <td class="parameter_description">
  1187. <p></p>
  1188. <p>Passed as <code class="code">month</code></p>
  1189. </td>
  1190. </tr>
  1191. <tr>
  1192. <td class="parameter_name"><p>day</p></td>
  1193. <td class="parameter_description">
  1194. <p></p>
  1195. <p>Passed as <code class="code">day</code></p>
  1196. </td>
  1197. </tr>
  1198. <tr>
  1199. <td class="parameter_name"><p>hour</p></td>
  1200. <td class="parameter_description">
  1201. <p></p>
  1202. <p>Passed as <code class="code">hour</code></p>
  1203. </td>
  1204. </tr>
  1205. <tr>
  1206. <td class="parameter_name"><p>minute</p></td>
  1207. <td class="parameter_description">
  1208. <p></p>
  1209. <p>Passed as <code class="code">minute</code></p>
  1210. </td>
  1211. </tr>
  1212. <tr>
  1213. <td class="parameter_name"><p>seconds</p></td>
  1214. <td class="parameter_description">
  1215. <p></p>
  1216. <p>Passed as <code class="code">seconds</code></p>
  1217. </td>
  1218. </tr>
  1219. </table></div>
  1220. </div>
  1221. </div>
  1222. <div class="refsect2">
  1223. <a name="id-1.1.13.3.46"></a><h3>date-time:compare</h3>
  1224. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:compare dt1 dt2))
  1225. </pre></div>
  1226. <p>A comparison function for <span class="type">GDateTimes</span> that is suitable
  1227. as a <span class="type">GCompareFunc</span>. Both <span class="type">GDateTimes</span> must be non-<code class="constant">NULL</code>.</p>
  1228. <div class="refsect3">
  1229. <a name="id-1.1.13.3.46.4"></a><h4>Parameters</h4>
  1230. <div class="informaltable"><table>
  1231. <tr>
  1232. <td class="parameter_name"><p>dt1</p></td>
  1233. <td class="parameter_description">
  1234. <p>first <span class="type">GDateTime</span> to compare</p>
  1235. <p>Passed as <code class="code">dt1</code></p>
  1236. </td>
  1237. </tr>
  1238. <tr>
  1239. <td class="parameter_name"><p>dt2</p></td>
  1240. <td class="parameter_description">
  1241. <p>second <span class="type">GDateTime</span> to compare</p>
  1242. <p>Passed as <code class="code">dt2</code></p>
  1243. </td>
  1244. </tr>
  1245. </table></div>
  1246. </div>
  1247. </div>
  1248. <div class="refsect2">
  1249. <a name="id-1.1.13.3.47"></a><h3>date-time:equal?</h3>
  1250. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:equal? dt1 dt2))
  1251. </pre></div>
  1252. <p>Checks to see if <em class="parameter"><code>dt1</code></em> and <em class="parameter"><code>dt2</code></em> are equal.
  1253. </p>
  1254. <p>Equal here means that they represent the same moment after converting
  1255. them to the same time zone.</p>
  1256. <div class="refsect3">
  1257. <a name="id-1.1.13.3.47.5"></a><h4>Parameters</h4>
  1258. <div class="informaltable"><table>
  1259. <tr>
  1260. <td class="parameter_name"><p>dt1</p></td>
  1261. <td class="parameter_description">
  1262. <p>a <span class="type">GDateTime</span></p>
  1263. <p>Passed as <code class="code">dt1</code></p>
  1264. </td>
  1265. </tr>
  1266. <tr>
  1267. <td class="parameter_name"><p>dt2</p></td>
  1268. <td class="parameter_description">
  1269. <p>a <span class="type">GDateTime</span></p>
  1270. <p>Passed as <code class="code">dt2</code></p>
  1271. </td>
  1272. </tr>
  1273. </table></div>
  1274. </div>
  1275. </div>
  1276. <div class="refsect2">
  1277. <a name="id-1.1.13.3.48"></a><h3>date-time:hash</h3>
  1278. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date-time:hash datetime))
  1279. </pre></div>
  1280. <p>Hashes <em class="parameter"><code>datetime</code></em> into a <span class="type">guint</span>, suitable for use within <span class="type">GHashTable</span>.</p>
  1281. <div class="refsect3">
  1282. <a name="id-1.1.13.3.48.4"></a><h4>Parameters</h4>
  1283. <div class="informaltable"><table><tr>
  1284. <td class="parameter_name"><p>datetime</p></td>
  1285. <td class="parameter_description">
  1286. <p>a <span class="type">GDateTime</span></p>
  1287. <p>Passed as <code class="code">datetime</code></p>
  1288. </td>
  1289. </tr></table></div>
  1290. </div>
  1291. </div>
  1292. </div>
  1293. </div>
  1294. <div class="footer">
  1295. <hr>Generated by GTK-Doc V1.33.1</div>
  1296. </body>
  1297. </html>