re09.html 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183
  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;GDate&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="re08.html" title="&lt;%GLibConvertError&gt;">
  10. <link rel="next" href="re10.html" title="&lt;%GLibDateDMY&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="re08.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
  20. <td><a accesskey="n" href="re10.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.10"></a><div class="titlepage"></div>
  24. <div class="refnamediv">
  25. <h2>&lt;GDate&gt;</h2>
  26. <p>&lt;GDate&gt;</p>
  27. </div>
  28. <div class="refsect1">
  29. <a name="id-1.1.10.2"></a><h2>Description</h2>
  30. <p>Represents a day between January 1, Year 1 and a few thousand years in
  31. the future. None of its members should be accessed directly.
  32. </p>
  33. <p>If the <span class="type">GDate</span>-struct is obtained from <code class="function">g_date_new()</code>, it will be safe
  34. to mutate but invalid and thus not safe for calendrical computations.
  35. </p>
  36. <p>If it's declared on the stack, it will contain garbage so must be
  37. initialized with <code class="function">g_date_clear()</code>. <code class="function">g_date_clear()</code> makes the date invalid
  38. but safe. An invalid date doesn't represent a day, it's "empty." A date
  39. becomes valid after you set it to a Julian day or you set a day, month,
  40. and year.</p>
  41. </div>
  42. <div class="refsect1">
  43. <a name="id-1.1.10.3"></a><h2>Functions</h2>
  44. <div class="refsect2">
  45. <a name="id-1.1.10.3.2"></a><h3>add-days</h3>
  46. <div class="informalexample"><pre class="programlisting">(define-values () (date:add-days self n-days))
  47. </pre></div>
  48. <p>Increments a date some number of days.
  49. To move forward by weeks, add weeks*7 days.
  50. The date must be valid.</p>
  51. <div class="refsect3">
  52. <a name="id-1.1.10.3.2.4"></a><h4>Parameters</h4>
  53. <div class="informaltable"><table>
  54. <tr>
  55. <td class="parameter_name"><p>date</p></td>
  56. <td class="parameter_description">
  57. <p>a <span class="type">GDate</span> to increment</p>
  58. <p>Passed as <code class="code">self</code></p>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td class="parameter_name"><p>n_days</p></td>
  63. <td class="parameter_description">
  64. <p>number of days to move the date forward</p>
  65. <p>Passed as <code class="code">n-days</code></p>
  66. </td>
  67. </tr>
  68. </table></div>
  69. </div>
  70. </div>
  71. <div class="refsect2">
  72. <a name="id-1.1.10.3.3"></a><h3>add-months</h3>
  73. <div class="informalexample"><pre class="programlisting">(define-values () (date:add-months self n-months))
  74. </pre></div>
  75. <p>Increments a date by some number of months.
  76. If the day of the month is greater than 28,
  77. this routine may change the day of the month
  78. (because the destination month may not have
  79. the current day in it). The date must be valid.</p>
  80. <div class="refsect3">
  81. <a name="id-1.1.10.3.3.4"></a><h4>Parameters</h4>
  82. <div class="informaltable"><table>
  83. <tr>
  84. <td class="parameter_name"><p>date</p></td>
  85. <td class="parameter_description">
  86. <p>a <span class="type">GDate</span> to increment</p>
  87. <p>Passed as <code class="code">self</code></p>
  88. </td>
  89. </tr>
  90. <tr>
  91. <td class="parameter_name"><p>n_months</p></td>
  92. <td class="parameter_description">
  93. <p>number of months to move forward</p>
  94. <p>Passed as <code class="code">n-months</code></p>
  95. </td>
  96. </tr>
  97. </table></div>
  98. </div>
  99. </div>
  100. <div class="refsect2">
  101. <a name="id-1.1.10.3.4"></a><h3>add-years</h3>
  102. <div class="informalexample"><pre class="programlisting">(define-values () (date:add-years self n-years))
  103. </pre></div>
  104. <p>Increments a date by some number of years.
  105. If the date is February 29, and the destination
  106. year is not a leap year, the date will be changed
  107. to February 28. The date must be valid.</p>
  108. <div class="refsect3">
  109. <a name="id-1.1.10.3.4.4"></a><h4>Parameters</h4>
  110. <div class="informaltable"><table>
  111. <tr>
  112. <td class="parameter_name"><p>date</p></td>
  113. <td class="parameter_description">
  114. <p>a <span class="type">GDate</span> to increment</p>
  115. <p>Passed as <code class="code">self</code></p>
  116. </td>
  117. </tr>
  118. <tr>
  119. <td class="parameter_name"><p>n_years</p></td>
  120. <td class="parameter_description">
  121. <p>number of years to move forward</p>
  122. <p>Passed as <code class="code">n-years</code></p>
  123. </td>
  124. </tr>
  125. </table></div>
  126. </div>
  127. </div>
  128. <div class="refsect2">
  129. <a name="id-1.1.10.3.5"></a><h3>clamp</h3>
  130. <div class="informalexample"><pre class="programlisting">(define-values () (date:clamp self min-date max-date))
  131. </pre></div>
  132. <p>If <em class="parameter"><code>date</code></em> is prior to <em class="parameter"><code>min_date</code></em>, sets <em class="parameter"><code>date</code></em> equal to <em class="parameter"><code>min_date</code></em>.
  133. If <em class="parameter"><code>date</code></em> falls after <em class="parameter"><code>max_date</code></em>, sets <em class="parameter"><code>date</code></em> equal to <em class="parameter"><code>max_date</code></em>.
  134. Otherwise, <em class="parameter"><code>date</code></em> is unchanged.
  135. Either of <em class="parameter"><code>min_date</code></em> and <em class="parameter"><code>max_date</code></em> may be <code class="constant">NULL</code>.
  136. All non-<code class="constant">NULL</code> dates must be valid.</p>
  137. <div class="refsect3">
  138. <a name="id-1.1.10.3.5.4"></a><h4>Parameters</h4>
  139. <div class="informaltable"><table>
  140. <tr>
  141. <td class="parameter_name"><p>date</p></td>
  142. <td class="parameter_description">
  143. <p>a <span class="type">GDate</span> to clamp</p>
  144. <p>Passed as <code class="code">self</code></p>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td class="parameter_name"><p>min_date</p></td>
  149. <td class="parameter_description">
  150. <p>minimum accepted value for <em class="parameter"><code>date</code></em></p>
  151. <p>Passed as <code class="code">min-date</code></p>
  152. </td>
  153. </tr>
  154. <tr>
  155. <td class="parameter_name"><p>max_date</p></td>
  156. <td class="parameter_description">
  157. <p>maximum accepted value for <em class="parameter"><code>date</code></em></p>
  158. <p>Passed as <code class="code">max-date</code></p>
  159. </td>
  160. </tr>
  161. </table></div>
  162. </div>
  163. </div>
  164. <div class="refsect2">
  165. <a name="id-1.1.10.3.6"></a><h3>clear</h3>
  166. <div class="informalexample"><pre class="programlisting">(define-values () (date:clear self n-dates))
  167. </pre></div>
  168. <p>Initializes one or more <span class="type">GDate</span> structs to a safe but invalid
  169. state. The cleared dates will not represent an existing date, but will
  170. not contain garbage. Useful to init a date declared on the stack.
  171. Validity can be tested with <code class="function">g_date_valid()</code>.</p>
  172. <div class="refsect3">
  173. <a name="id-1.1.10.3.6.4"></a><h4>Parameters</h4>
  174. <div class="informaltable"><table>
  175. <tr>
  176. <td class="parameter_name"><p>date</p></td>
  177. <td class="parameter_description">
  178. <p>pointer to one or more dates to clear</p>
  179. <p>Passed as <code class="code">self</code></p>
  180. </td>
  181. </tr>
  182. <tr>
  183. <td class="parameter_name"><p>n_dates</p></td>
  184. <td class="parameter_description">
  185. <p>number of dates to clear</p>
  186. <p>Passed as <code class="code">n-dates</code></p>
  187. </td>
  188. </tr>
  189. </table></div>
  190. </div>
  191. </div>
  192. <div class="refsect2">
  193. <a name="id-1.1.10.3.7"></a><h3>compare</h3>
  194. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:compare self rhs))
  195. </pre></div>
  196. <p><code class="function">qsort()</code>-style comparison function for dates.
  197. Both dates must be valid.</p>
  198. <div class="refsect3">
  199. <a name="id-1.1.10.3.7.4"></a><h4>Parameters</h4>
  200. <div class="informaltable"><table>
  201. <tr>
  202. <td class="parameter_name"><p>lhs</p></td>
  203. <td class="parameter_description">
  204. <p>first date to compare</p>
  205. <p>Passed as <code class="code">self</code></p>
  206. </td>
  207. </tr>
  208. <tr>
  209. <td class="parameter_name"><p>rhs</p></td>
  210. <td class="parameter_description">
  211. <p>second date to compare</p>
  212. <p>Passed as <code class="code">rhs</code></p>
  213. </td>
  214. </tr>
  215. </table></div>
  216. </div>
  217. </div>
  218. <div class="refsect2">
  219. <a name="id-1.1.10.3.8"></a><h3>copy</h3>
  220. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:copy self))
  221. </pre></div>
  222. <p>Copies a GDate to a newly-allocated GDate. If the input was invalid
  223. (as determined by <code class="function">g_date_valid()</code>), the invalid state will be copied
  224. as is into the new object.</p>
  225. <div class="refsect3">
  226. <a name="id-1.1.10.3.8.4"></a><h4>Parameters</h4>
  227. <div class="informaltable"><table><tr>
  228. <td class="parameter_name"><p>date</p></td>
  229. <td class="parameter_description">
  230. <p>a <span class="type">GDate</span> to copy</p>
  231. <p>Passed as <code class="code">self</code></p>
  232. </td>
  233. </tr></table></div>
  234. </div>
  235. </div>
  236. <div class="refsect2">
  237. <a name="id-1.1.10.3.9"></a><h3>days-between</h3>
  238. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:days-between self date2))
  239. </pre></div>
  240. <p>Computes the number of days between two dates.
  241. If <em class="parameter"><code>date2</code></em> is prior to <em class="parameter"><code>date1</code></em>, the returned value is negative.
  242. Both dates must be valid.</p>
  243. <div class="refsect3">
  244. <a name="id-1.1.10.3.9.4"></a><h4>Parameters</h4>
  245. <div class="informaltable"><table>
  246. <tr>
  247. <td class="parameter_name"><p>date1</p></td>
  248. <td class="parameter_description">
  249. <p>the first date</p>
  250. <p>Passed as <code class="code">self</code></p>
  251. </td>
  252. </tr>
  253. <tr>
  254. <td class="parameter_name"><p>date2</p></td>
  255. <td class="parameter_description">
  256. <p>the second date</p>
  257. <p>Passed as <code class="code">date2</code></p>
  258. </td>
  259. </tr>
  260. </table></div>
  261. </div>
  262. </div>
  263. <div class="refsect2">
  264. <a name="id-1.1.10.3.10"></a><h3>free</h3>
  265. <div class="informalexample"><pre class="programlisting">(define-values () (date:free self))
  266. </pre></div>
  267. <p>Frees a <span class="type">GDate</span> returned from <code class="function">g_date_new()</code>.</p>
  268. <div class="refsect3">
  269. <a name="id-1.1.10.3.10.4"></a><h4>Parameters</h4>
  270. <div class="informaltable"><table><tr>
  271. <td class="parameter_name"><p>date</p></td>
  272. <td class="parameter_description">
  273. <p>a <span class="type">GDate</span> to free</p>
  274. <p>Passed as <code class="code">self</code></p>
  275. </td>
  276. </tr></table></div>
  277. </div>
  278. </div>
  279. <div class="refsect2">
  280. <a name="id-1.1.10.3.11"></a><h3>get-day</h3>
  281. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-day self))
  282. </pre></div>
  283. <p>Returns the day of the month. The date must be valid.</p>
  284. <div class="refsect3">
  285. <a name="id-1.1.10.3.11.4"></a><h4>Parameters</h4>
  286. <div class="informaltable"><table><tr>
  287. <td class="parameter_name"><p>date</p></td>
  288. <td class="parameter_description">
  289. <p>a <span class="type">GDate</span> to extract the day of the month from</p>
  290. <p>Passed as <code class="code">self</code></p>
  291. </td>
  292. </tr></table></div>
  293. </div>
  294. </div>
  295. <div class="refsect2">
  296. <a name="id-1.1.10.3.12"></a><h3>get-day-of-year</h3>
  297. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-day-of-year self))
  298. </pre></div>
  299. <p>Returns the day of the year, where Jan 1 is the first day of the
  300. year. The date must be valid.</p>
  301. <div class="refsect3">
  302. <a name="id-1.1.10.3.12.4"></a><h4>Parameters</h4>
  303. <div class="informaltable"><table><tr>
  304. <td class="parameter_name"><p>date</p></td>
  305. <td class="parameter_description">
  306. <p>a <span class="type">GDate</span> to extract day of year from</p>
  307. <p>Passed as <code class="code">self</code></p>
  308. </td>
  309. </tr></table></div>
  310. </div>
  311. </div>
  312. <div class="refsect2">
  313. <a name="id-1.1.10.3.13"></a><h3>get-iso8601-week-of-year</h3>
  314. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-iso8601-week-of-year self))
  315. </pre></div>
  316. <p>Returns the week of the year, where weeks are interpreted according
  317. to ISO 8601.</p>
  318. <div class="refsect3">
  319. <a name="id-1.1.10.3.13.4"></a><h4>Parameters</h4>
  320. <div class="informaltable"><table><tr>
  321. <td class="parameter_name"><p>date</p></td>
  322. <td class="parameter_description">
  323. <p>a valid <span class="type">GDate</span></p>
  324. <p>Passed as <code class="code">self</code></p>
  325. </td>
  326. </tr></table></div>
  327. </div>
  328. </div>
  329. <div class="refsect2">
  330. <a name="id-1.1.10.3.14"></a><h3>get-julian</h3>
  331. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-julian self))
  332. </pre></div>
  333. <p>Returns the Julian day or "serial number" of the <span class="type">GDate</span>. The
  334. Julian day is simply the number of days since January 1, Year 1; i.e.,
  335. January 1, Year 1 is Julian day 1; January 2, Year 1 is Julian day 2,
  336. etc. The date must be valid.</p>
  337. <div class="refsect3">
  338. <a name="id-1.1.10.3.14.4"></a><h4>Parameters</h4>
  339. <div class="informaltable"><table><tr>
  340. <td class="parameter_name"><p>date</p></td>
  341. <td class="parameter_description">
  342. <p>a <span class="type">GDate</span> to extract the Julian day from</p>
  343. <p>Passed as <code class="code">self</code></p>
  344. </td>
  345. </tr></table></div>
  346. </div>
  347. </div>
  348. <div class="refsect2">
  349. <a name="id-1.1.10.3.15"></a><h3>get-monday-week-of-year</h3>
  350. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-monday-week-of-year self))
  351. </pre></div>
  352. <p>Returns the week of the year, where weeks are understood to start on
  353. Monday. If the date is before the first Monday of the year, return 0.
  354. The date must be valid.</p>
  355. <div class="refsect3">
  356. <a name="id-1.1.10.3.15.4"></a><h4>Parameters</h4>
  357. <div class="informaltable"><table><tr>
  358. <td class="parameter_name"><p>date</p></td>
  359. <td class="parameter_description">
  360. <p>a <span class="type">GDate</span></p>
  361. <p>Passed as <code class="code">self</code></p>
  362. </td>
  363. </tr></table></div>
  364. </div>
  365. </div>
  366. <div class="refsect2">
  367. <a name="id-1.1.10.3.16"></a><h3>get-month</h3>
  368. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-month self))
  369. </pre></div>
  370. <p>Returns the month of the year. The date must be valid.</p>
  371. <div class="refsect3">
  372. <a name="id-1.1.10.3.16.4"></a><h4>Parameters</h4>
  373. <div class="informaltable"><table><tr>
  374. <td class="parameter_name"><p>date</p></td>
  375. <td class="parameter_description">
  376. <p>a <span class="type">GDate</span> to get the month from</p>
  377. <p>Passed as <code class="code">self</code></p>
  378. </td>
  379. </tr></table></div>
  380. </div>
  381. </div>
  382. <div class="refsect2">
  383. <a name="id-1.1.10.3.17"></a><h3>get-sunday-week-of-year</h3>
  384. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-sunday-week-of-year self))
  385. </pre></div>
  386. <p>Returns the week of the year during which this date falls, if
  387. weeks are understood to begin on Sunday. The date must be valid.
  388. Can return 0 if the day is before the first Sunday of the year.</p>
  389. <div class="refsect3">
  390. <a name="id-1.1.10.3.17.4"></a><h4>Parameters</h4>
  391. <div class="informaltable"><table><tr>
  392. <td class="parameter_name"><p>date</p></td>
  393. <td class="parameter_description">
  394. <p>a <span class="type">GDate</span></p>
  395. <p>Passed as <code class="code">self</code></p>
  396. </td>
  397. </tr></table></div>
  398. </div>
  399. </div>
  400. <div class="refsect2">
  401. <a name="id-1.1.10.3.18"></a><h3>get-weekday</h3>
  402. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-weekday self))
  403. </pre></div>
  404. <p>Returns the day of the week for a <span class="type">GDate</span>. The date must be valid.</p>
  405. <div class="refsect3">
  406. <a name="id-1.1.10.3.18.4"></a><h4>Parameters</h4>
  407. <div class="informaltable"><table><tr>
  408. <td class="parameter_name"><p>date</p></td>
  409. <td class="parameter_description">
  410. <p>a <span class="type">GDate</span></p>
  411. <p>Passed as <code class="code">self</code></p>
  412. </td>
  413. </tr></table></div>
  414. </div>
  415. </div>
  416. <div class="refsect2">
  417. <a name="id-1.1.10.3.19"></a><h3>get-year</h3>
  418. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-year self))
  419. </pre></div>
  420. <p>Returns the year of a <span class="type">GDate</span>. The date must be valid.</p>
  421. <div class="refsect3">
  422. <a name="id-1.1.10.3.19.4"></a><h4>Parameters</h4>
  423. <div class="informaltable"><table><tr>
  424. <td class="parameter_name"><p>date</p></td>
  425. <td class="parameter_description">
  426. <p>a <span class="type">GDate</span></p>
  427. <p>Passed as <code class="code">self</code></p>
  428. </td>
  429. </tr></table></div>
  430. </div>
  431. </div>
  432. <div class="refsect2">
  433. <a name="id-1.1.10.3.20"></a><h3>is-first-of-month?</h3>
  434. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:is-first-of-month? self))
  435. </pre></div>
  436. <p>Returns <code class="constant">TRUE</code> if the date is on the first of a month.
  437. The date must be valid.</p>
  438. <div class="refsect3">
  439. <a name="id-1.1.10.3.20.4"></a><h4>Parameters</h4>
  440. <div class="informaltable"><table><tr>
  441. <td class="parameter_name"><p>date</p></td>
  442. <td class="parameter_description">
  443. <p>a <span class="type">GDate</span> to check</p>
  444. <p>Passed as <code class="code">self</code></p>
  445. </td>
  446. </tr></table></div>
  447. </div>
  448. </div>
  449. <div class="refsect2">
  450. <a name="id-1.1.10.3.21"></a><h3>is-last-of-month?</h3>
  451. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:is-last-of-month? self))
  452. </pre></div>
  453. <p>Returns <code class="constant">TRUE</code> if the date is the last day of the month.
  454. The date must be valid.</p>
  455. <div class="refsect3">
  456. <a name="id-1.1.10.3.21.4"></a><h4>Parameters</h4>
  457. <div class="informaltable"><table><tr>
  458. <td class="parameter_name"><p>date</p></td>
  459. <td class="parameter_description">
  460. <p>a <span class="type">GDate</span> to check</p>
  461. <p>Passed as <code class="code">self</code></p>
  462. </td>
  463. </tr></table></div>
  464. </div>
  465. </div>
  466. <div class="refsect2">
  467. <a name="id-1.1.10.3.22"></a><h3>order</h3>
  468. <div class="informalexample"><pre class="programlisting">(define-values () (date:order self date2))
  469. </pre></div>
  470. <p>Checks if <em class="parameter"><code>date1</code></em> is less than or equal to <em class="parameter"><code>date2</code></em>,
  471. and swap the values if this is not the case.</p>
  472. <div class="refsect3">
  473. <a name="id-1.1.10.3.22.4"></a><h4>Parameters</h4>
  474. <div class="informaltable"><table>
  475. <tr>
  476. <td class="parameter_name"><p>date1</p></td>
  477. <td class="parameter_description">
  478. <p>the first date</p>
  479. <p>Passed as <code class="code">self</code></p>
  480. </td>
  481. </tr>
  482. <tr>
  483. <td class="parameter_name"><p>date2</p></td>
  484. <td class="parameter_description">
  485. <p>the second date</p>
  486. <p>Passed as <code class="code">date2</code></p>
  487. </td>
  488. </tr>
  489. </table></div>
  490. </div>
  491. </div>
  492. <div class="refsect2">
  493. <a name="id-1.1.10.3.23"></a><h3>set-day</h3>
  494. <div class="informalexample"><pre class="programlisting">(define-values () (date:set-day self day))
  495. </pre></div>
  496. <p>Sets the day of the month for a <span class="type">GDate</span>. If the resulting
  497. day-month-year triplet is invalid, the date will be invalid.</p>
  498. <div class="refsect3">
  499. <a name="id-1.1.10.3.23.4"></a><h4>Parameters</h4>
  500. <div class="informaltable"><table>
  501. <tr>
  502. <td class="parameter_name"><p>date</p></td>
  503. <td class="parameter_description">
  504. <p>a <span class="type">GDate</span></p>
  505. <p>Passed as <code class="code">self</code></p>
  506. </td>
  507. </tr>
  508. <tr>
  509. <td class="parameter_name"><p>day</p></td>
  510. <td class="parameter_description">
  511. <p>day to set</p>
  512. <p>Passed as <code class="code">day</code></p>
  513. </td>
  514. </tr>
  515. </table></div>
  516. </div>
  517. </div>
  518. <div class="refsect2">
  519. <a name="id-1.1.10.3.24"></a><h3>set-dmy</h3>
  520. <div class="informalexample"><pre class="programlisting">(define-values () (date:set-dmy self day month y))
  521. </pre></div>
  522. <p>Sets the value of a <span class="type">GDate</span> from a day, month, and year.
  523. The day-month-year triplet must be valid; if you aren't
  524. sure it is, call <code class="function">g_date_valid_dmy()</code> to check before you
  525. set it.</p>
  526. <div class="refsect3">
  527. <a name="id-1.1.10.3.24.4"></a><h4>Parameters</h4>
  528. <div class="informaltable"><table>
  529. <tr>
  530. <td class="parameter_name"><p>date</p></td>
  531. <td class="parameter_description">
  532. <p>a <span class="type">GDate</span></p>
  533. <p>Passed as <code class="code">self</code></p>
  534. </td>
  535. </tr>
  536. <tr>
  537. <td class="parameter_name"><p>day</p></td>
  538. <td class="parameter_description">
  539. <p>day</p>
  540. <p>Passed as <code class="code">day</code></p>
  541. </td>
  542. </tr>
  543. <tr>
  544. <td class="parameter_name"><p>month</p></td>
  545. <td class="parameter_description">
  546. <p>month</p>
  547. <p>Passed as <code class="code">month</code></p>
  548. </td>
  549. </tr>
  550. <tr>
  551. <td class="parameter_name"><p>y</p></td>
  552. <td class="parameter_description">
  553. <p>year</p>
  554. <p>Passed as <code class="code">y</code></p>
  555. </td>
  556. </tr>
  557. </table></div>
  558. </div>
  559. </div>
  560. <div class="refsect2">
  561. <a name="id-1.1.10.3.25"></a><h3>set-julian</h3>
  562. <div class="informalexample"><pre class="programlisting">(define-values () (date:set-julian self julian-date))
  563. </pre></div>
  564. <p>Sets the value of a <span class="type">GDate</span> from a Julian day number.</p>
  565. <div class="refsect3">
  566. <a name="id-1.1.10.3.25.4"></a><h4>Parameters</h4>
  567. <div class="informaltable"><table>
  568. <tr>
  569. <td class="parameter_name"><p>date</p></td>
  570. <td class="parameter_description">
  571. <p>a <span class="type">GDate</span></p>
  572. <p>Passed as <code class="code">self</code></p>
  573. </td>
  574. </tr>
  575. <tr>
  576. <td class="parameter_name"><p>julian_date</p></td>
  577. <td class="parameter_description">
  578. <p>Julian day number (days since January 1, Year 1)</p>
  579. <p>Passed as <code class="code">julian-date</code></p>
  580. </td>
  581. </tr>
  582. </table></div>
  583. </div>
  584. </div>
  585. <div class="refsect2">
  586. <a name="id-1.1.10.3.26"></a><h3>set-month</h3>
  587. <div class="informalexample"><pre class="programlisting">(define-values () (date:set-month self month))
  588. </pre></div>
  589. <p>Sets the month of the year for a <span class="type">GDate</span>. If the resulting
  590. day-month-year triplet is invalid, the date will be invalid.</p>
  591. <div class="refsect3">
  592. <a name="id-1.1.10.3.26.4"></a><h4>Parameters</h4>
  593. <div class="informaltable"><table>
  594. <tr>
  595. <td class="parameter_name"><p>date</p></td>
  596. <td class="parameter_description">
  597. <p>a <span class="type">GDate</span></p>
  598. <p>Passed as <code class="code">self</code></p>
  599. </td>
  600. </tr>
  601. <tr>
  602. <td class="parameter_name"><p>month</p></td>
  603. <td class="parameter_description">
  604. <p>month to set</p>
  605. <p>Passed as <code class="code">month</code></p>
  606. </td>
  607. </tr>
  608. </table></div>
  609. </div>
  610. </div>
  611. <div class="refsect2">
  612. <a name="id-1.1.10.3.27"></a><h3>set-parse</h3>
  613. <div class="informalexample"><pre class="programlisting">(define-values () (date:set-parse self str))
  614. </pre></div>
  615. <p>Parses a user-inputted string <em class="parameter"><code>str</code></em>, and try to figure out what date it
  616. represents, taking the [current locale][setlocale] into account. If the
  617. string is successfully parsed, the date will be valid after the call.
  618. Otherwise, it will be invalid. You should check using <code class="function">g_date_valid()</code>
  619. to see whether the parsing succeeded.
  620. </p>
  621. <p>This function is not appropriate for file formats and the like; it
  622. isn't very precise, and its exact behavior varies with the locale.
  623. It's intended to be a heuristic routine that guesses what the user
  624. means by a given string (and it does work pretty well in that
  625. capacity).</p>
  626. <div class="refsect3">
  627. <a name="id-1.1.10.3.27.5"></a><h4>Parameters</h4>
  628. <div class="informaltable"><table>
  629. <tr>
  630. <td class="parameter_name"><p>date</p></td>
  631. <td class="parameter_description">
  632. <p>a <span class="type">GDate</span> to fill in</p>
  633. <p>Passed as <code class="code">self</code></p>
  634. </td>
  635. </tr>
  636. <tr>
  637. <td class="parameter_name"><p>str</p></td>
  638. <td class="parameter_description">
  639. <p>string to parse</p>
  640. <p>Passed as <code class="code">str</code></p>
  641. </td>
  642. </tr>
  643. </table></div>
  644. </div>
  645. </div>
  646. <div class="refsect2">
  647. <a name="id-1.1.10.3.28"></a><h3>set-time</h3>
  648. <div class="informalexample"><pre class="programlisting">(define-values () (date:set-time self time-))
  649. </pre></div>
  650. <p>Sets the value of a date from a <span class="type">GTime</span> value.
  651. The time to date conversion is done using the user's current timezone.</p>
  652. <div class="refsect3">
  653. <a name="id-1.1.10.3.28.4"></a><h4>Parameters</h4>
  654. <div class="informaltable"><table>
  655. <tr>
  656. <td class="parameter_name"><p>date</p></td>
  657. <td class="parameter_description">
  658. <p>a <span class="type">GDate</span>.</p>
  659. <p>Passed as <code class="code">self</code></p>
  660. </td>
  661. </tr>
  662. <tr>
  663. <td class="parameter_name"><p>time_</p></td>
  664. <td class="parameter_description">
  665. <p><span class="type">GTime</span> value to set.</p>
  666. <p>Passed as <code class="code">time-</code></p>
  667. </td>
  668. </tr>
  669. </table></div>
  670. </div>
  671. </div>
  672. <div class="refsect2">
  673. <a name="id-1.1.10.3.29"></a><h3>set-time-t</h3>
  674. <div class="informalexample"><pre class="programlisting">(define-values () (date:set-time-t self timet))
  675. </pre></div>
  676. <p>Sets the value of a date to the date corresponding to a time
  677. specified as a time_t. The time to date conversion is done using
  678. the user's current timezone.
  679. </p>
  680. <p>To set the value of a date to the current day, you could write:
  681. </p>
  682. <div class="informalexample"><pre class="programlisting">
  683. time_t now = time (NULL);
  684. if (now == (time_t) -1)
  685. // handle the error
  686. g_date_set_time_t (date, now);
  687. </pre></div>
  688. <div class="refsect3">
  689. <a name="id-1.1.10.3.29.5"></a><h4>Parameters</h4>
  690. <div class="informaltable"><table>
  691. <tr>
  692. <td class="parameter_name"><p>date</p></td>
  693. <td class="parameter_description">
  694. <p>a <span class="type">GDate</span></p>
  695. <p>Passed as <code class="code">self</code></p>
  696. </td>
  697. </tr>
  698. <tr>
  699. <td class="parameter_name"><p>timet</p></td>
  700. <td class="parameter_description">
  701. <p>time_t value to set</p>
  702. <p>Passed as <code class="code">timet</code></p>
  703. </td>
  704. </tr>
  705. </table></div>
  706. </div>
  707. </div>
  708. <div class="refsect2">
  709. <a name="id-1.1.10.3.30"></a><h3>set-year</h3>
  710. <div class="informalexample"><pre class="programlisting">(define-values () (date:set-year self year))
  711. </pre></div>
  712. <p>Sets the year for a <span class="type">GDate</span>. If the resulting day-month-year
  713. triplet is invalid, the date will be invalid.</p>
  714. <div class="refsect3">
  715. <a name="id-1.1.10.3.30.4"></a><h4>Parameters</h4>
  716. <div class="informaltable"><table>
  717. <tr>
  718. <td class="parameter_name"><p>date</p></td>
  719. <td class="parameter_description">
  720. <p>a <span class="type">GDate</span></p>
  721. <p>Passed as <code class="code">self</code></p>
  722. </td>
  723. </tr>
  724. <tr>
  725. <td class="parameter_name"><p>year</p></td>
  726. <td class="parameter_description">
  727. <p>year to set</p>
  728. <p>Passed as <code class="code">year</code></p>
  729. </td>
  730. </tr>
  731. </table></div>
  732. </div>
  733. </div>
  734. <div class="refsect2">
  735. <a name="id-1.1.10.3.31"></a><h3>subtract-days</h3>
  736. <div class="informalexample"><pre class="programlisting">(define-values () (date:subtract-days self n-days))
  737. </pre></div>
  738. <p>Moves a date some number of days into the past.
  739. To move by weeks, just move by weeks*7 days.
  740. The date must be valid.</p>
  741. <div class="refsect3">
  742. <a name="id-1.1.10.3.31.4"></a><h4>Parameters</h4>
  743. <div class="informaltable"><table>
  744. <tr>
  745. <td class="parameter_name"><p>date</p></td>
  746. <td class="parameter_description">
  747. <p>a <span class="type">GDate</span> to decrement</p>
  748. <p>Passed as <code class="code">self</code></p>
  749. </td>
  750. </tr>
  751. <tr>
  752. <td class="parameter_name"><p>n_days</p></td>
  753. <td class="parameter_description">
  754. <p>number of days to move</p>
  755. <p>Passed as <code class="code">n-days</code></p>
  756. </td>
  757. </tr>
  758. </table></div>
  759. </div>
  760. </div>
  761. <div class="refsect2">
  762. <a name="id-1.1.10.3.32"></a><h3>subtract-months</h3>
  763. <div class="informalexample"><pre class="programlisting">(define-values () (date:subtract-months self n-months))
  764. </pre></div>
  765. <p>Moves a date some number of months into the past.
  766. If the current day of the month doesn't exist in
  767. the destination month, the day of the month
  768. may change. The date must be valid.</p>
  769. <div class="refsect3">
  770. <a name="id-1.1.10.3.32.4"></a><h4>Parameters</h4>
  771. <div class="informaltable"><table>
  772. <tr>
  773. <td class="parameter_name"><p>date</p></td>
  774. <td class="parameter_description">
  775. <p>a <span class="type">GDate</span> to decrement</p>
  776. <p>Passed as <code class="code">self</code></p>
  777. </td>
  778. </tr>
  779. <tr>
  780. <td class="parameter_name"><p>n_months</p></td>
  781. <td class="parameter_description">
  782. <p>number of months to move</p>
  783. <p>Passed as <code class="code">n-months</code></p>
  784. </td>
  785. </tr>
  786. </table></div>
  787. </div>
  788. </div>
  789. <div class="refsect2">
  790. <a name="id-1.1.10.3.33"></a><h3>subtract-years</h3>
  791. <div class="informalexample"><pre class="programlisting">(define-values () (date:subtract-years self n-years))
  792. </pre></div>
  793. <p>Moves a date some number of years into the past.
  794. If the current day doesn't exist in the destination
  795. year (i.e. it's February 29 and you move to a non-leap-year)
  796. then the day is changed to February 29. The date
  797. must be valid.</p>
  798. <div class="refsect3">
  799. <a name="id-1.1.10.3.33.4"></a><h4>Parameters</h4>
  800. <div class="informaltable"><table>
  801. <tr>
  802. <td class="parameter_name"><p>date</p></td>
  803. <td class="parameter_description">
  804. <p>a <span class="type">GDate</span> to decrement</p>
  805. <p>Passed as <code class="code">self</code></p>
  806. </td>
  807. </tr>
  808. <tr>
  809. <td class="parameter_name"><p>n_years</p></td>
  810. <td class="parameter_description">
  811. <p>number of years to move</p>
  812. <p>Passed as <code class="code">n-years</code></p>
  813. </td>
  814. </tr>
  815. </table></div>
  816. </div>
  817. </div>
  818. <div class="refsect2">
  819. <a name="id-1.1.10.3.34"></a><h3>to-struct-tm</h3>
  820. <div class="informalexample"><pre class="programlisting">(define-values () (date:to-struct-tm self tm))
  821. </pre></div>
  822. <p>Fills in the date-related bits of a struct tm using the <em class="parameter"><code>date</code></em> value.
  823. Initializes the non-date parts with something safe but meaningless.</p>
  824. <div class="refsect3">
  825. <a name="id-1.1.10.3.34.4"></a><h4>Parameters</h4>
  826. <div class="informaltable"><table>
  827. <tr>
  828. <td class="parameter_name"><p>date</p></td>
  829. <td class="parameter_description">
  830. <p>a <span class="type">GDate</span> to set the struct tm from</p>
  831. <p>Passed as <code class="code">self</code></p>
  832. </td>
  833. </tr>
  834. <tr>
  835. <td class="parameter_name"><p>tm</p></td>
  836. <td class="parameter_description">
  837. <p>struct tm to fill</p>
  838. <p>Passed as <code class="code">tm</code></p>
  839. </td>
  840. </tr>
  841. </table></div>
  842. </div>
  843. </div>
  844. <div class="refsect2">
  845. <a name="id-1.1.10.3.35"></a><h3>valid?</h3>
  846. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:valid? self))
  847. </pre></div>
  848. <p>Returns <code class="constant">TRUE</code> if the <span class="type">GDate</span> represents an existing day. The date must not
  849. contain garbage; it should have been initialized with <code class="function">g_date_clear()</code>
  850. if it wasn't allocated by one of the <code class="function">g_date_new()</code> variants.</p>
  851. <div class="refsect3">
  852. <a name="id-1.1.10.3.35.4"></a><h4>Parameters</h4>
  853. <div class="informaltable"><table><tr>
  854. <td class="parameter_name"><p>date</p></td>
  855. <td class="parameter_description">
  856. <p>a <span class="type">GDate</span> to check</p>
  857. <p>Passed as <code class="code">self</code></p>
  858. </td>
  859. </tr></table></div>
  860. </div>
  861. </div>
  862. <div class="refsect2">
  863. <a name="id-1.1.10.3.36"></a><h3>date:new-julian</h3>
  864. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:new-julian julian-day))
  865. </pre></div>
  866. <p>Undocumented</p>
  867. <div class="refsect3">
  868. <a name="id-1.1.10.3.36.4"></a><h4>Parameters</h4>
  869. <div class="informaltable"><table><tr>
  870. <td class="parameter_name"><p>julian_day</p></td>
  871. <td class="parameter_description">
  872. <p></p>
  873. <p>Passed as <code class="code">julian-day</code></p>
  874. </td>
  875. </tr></table></div>
  876. </div>
  877. </div>
  878. <div class="refsect2">
  879. <a name="id-1.1.10.3.37"></a><h3>date:new-dmy</h3>
  880. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:new-dmy day month year))
  881. </pre></div>
  882. <p>Undocumented</p>
  883. <div class="refsect3">
  884. <a name="id-1.1.10.3.37.4"></a><h4>Parameters</h4>
  885. <div class="informaltable"><table>
  886. <tr>
  887. <td class="parameter_name"><p>day</p></td>
  888. <td class="parameter_description">
  889. <p></p>
  890. <p>Passed as <code class="code">day</code></p>
  891. </td>
  892. </tr>
  893. <tr>
  894. <td class="parameter_name"><p>month</p></td>
  895. <td class="parameter_description">
  896. <p></p>
  897. <p>Passed as <code class="code">month</code></p>
  898. </td>
  899. </tr>
  900. <tr>
  901. <td class="parameter_name"><p>year</p></td>
  902. <td class="parameter_description">
  903. <p></p>
  904. <p>Passed as <code class="code">year</code></p>
  905. </td>
  906. </tr>
  907. </table></div>
  908. </div>
  909. </div>
  910. <div class="refsect2">
  911. <a name="id-1.1.10.3.38"></a><h3>date:new</h3>
  912. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:new))
  913. </pre></div>
  914. <p>Undocumented</p>
  915. </div>
  916. <div class="refsect2">
  917. <a name="id-1.1.10.3.39"></a><h3>date:get-days-in-month</h3>
  918. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-days-in-month month year))
  919. </pre></div>
  920. <p>Returns the number of days in a month, taking leap
  921. years into account.</p>
  922. <div class="refsect3">
  923. <a name="id-1.1.10.3.39.4"></a><h4>Parameters</h4>
  924. <div class="informaltable"><table>
  925. <tr>
  926. <td class="parameter_name"><p>month</p></td>
  927. <td class="parameter_description">
  928. <p>month</p>
  929. <p>Passed as <code class="code">month</code></p>
  930. </td>
  931. </tr>
  932. <tr>
  933. <td class="parameter_name"><p>year</p></td>
  934. <td class="parameter_description">
  935. <p>year</p>
  936. <p>Passed as <code class="code">year</code></p>
  937. </td>
  938. </tr>
  939. </table></div>
  940. </div>
  941. </div>
  942. <div class="refsect2">
  943. <a name="id-1.1.10.3.40"></a><h3>date:get-monday-weeks-in-year</h3>
  944. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-monday-weeks-in-year year))
  945. </pre></div>
  946. <p>Returns the number of weeks in the year, where weeks
  947. are taken to start on Monday. Will be 52 or 53. The
  948. date must be valid. (Years always have 52 7-day periods,
  949. plus 1 or 2 extra days depending on whether it's a leap
  950. year. This function is basically telling you how many
  951. Mondays are in the year, i.e. there are 53 Mondays if
  952. one of the extra days happens to be a Monday.)</p>
  953. <div class="refsect3">
  954. <a name="id-1.1.10.3.40.4"></a><h4>Parameters</h4>
  955. <div class="informaltable"><table><tr>
  956. <td class="parameter_name"><p>year</p></td>
  957. <td class="parameter_description">
  958. <p>a year</p>
  959. <p>Passed as <code class="code">year</code></p>
  960. </td>
  961. </tr></table></div>
  962. </div>
  963. </div>
  964. <div class="refsect2">
  965. <a name="id-1.1.10.3.41"></a><h3>date:get-sunday-weeks-in-year</h3>
  966. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:get-sunday-weeks-in-year year))
  967. </pre></div>
  968. <p>Returns the number of weeks in the year, where weeks
  969. are taken to start on Sunday. Will be 52 or 53. The
  970. date must be valid. (Years always have 52 7-day periods,
  971. plus 1 or 2 extra days depending on whether it's a leap
  972. year. This function is basically telling you how many
  973. Sundays are in the year, i.e. there are 53 Sundays if
  974. one of the extra days happens to be a Sunday.)</p>
  975. <div class="refsect3">
  976. <a name="id-1.1.10.3.41.4"></a><h4>Parameters</h4>
  977. <div class="informaltable"><table><tr>
  978. <td class="parameter_name"><p>year</p></td>
  979. <td class="parameter_description">
  980. <p>year to count weeks in</p>
  981. <p>Passed as <code class="code">year</code></p>
  982. </td>
  983. </tr></table></div>
  984. </div>
  985. </div>
  986. <div class="refsect2">
  987. <a name="id-1.1.10.3.42"></a><h3>date:is-leap-year?</h3>
  988. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:is-leap-year? year))
  989. </pre></div>
  990. <p>Returns <code class="constant">TRUE</code> if the year is a leap year.
  991. </p>
  992. <p>For the purposes of this function, leap year is every year
  993. divisible by 4 unless that year is divisible by 100. If it
  994. is divisible by 100 it would be a leap year only if that year
  995. is also divisible by 400.</p>
  996. <div class="refsect3">
  997. <a name="id-1.1.10.3.42.5"></a><h4>Parameters</h4>
  998. <div class="informaltable"><table><tr>
  999. <td class="parameter_name"><p>year</p></td>
  1000. <td class="parameter_description">
  1001. <p>year to check</p>
  1002. <p>Passed as <code class="code">year</code></p>
  1003. </td>
  1004. </tr></table></div>
  1005. </div>
  1006. </div>
  1007. <div class="refsect2">
  1008. <a name="id-1.1.10.3.43"></a><h3>date:strftime</h3>
  1009. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:strftime s slen format date))
  1010. </pre></div>
  1011. <p>Generates a printed representation of the date, in a
  1012. [locale][setlocale]-specific way.
  1013. Works just like the platform's C library <code class="function">strftime()</code> function,
  1014. but only accepts date-related formats; time-related formats
  1015. give undefined results. Date must be valid. Unlike <code class="function">strftime()</code>
  1016. (which uses the locale encoding), works on a UTF-8 format
  1017. string and stores a UTF-8 result.
  1018. </p>
  1019. <p>This function does not provide any conversion specifiers in
  1020. addition to those implemented by the platform's C library.
  1021. For example, don't expect that using <code class="function">g_date_strftime()</code> would
  1022. make the \%F provided by the C99 <code class="function">strftime()</code> work on Windows
  1023. where the C library only complies to C89.</p>
  1024. <div class="refsect3">
  1025. <a name="id-1.1.10.3.43.5"></a><h4>Parameters</h4>
  1026. <div class="informaltable"><table>
  1027. <tr>
  1028. <td class="parameter_name"><p>s</p></td>
  1029. <td class="parameter_description">
  1030. <p>destination buffer</p>
  1031. <p>Passed as <code class="code">s</code></p>
  1032. </td>
  1033. </tr>
  1034. <tr>
  1035. <td class="parameter_name"><p>slen</p></td>
  1036. <td class="parameter_description">
  1037. <p>buffer size</p>
  1038. <p>Passed as <code class="code">slen</code></p>
  1039. </td>
  1040. </tr>
  1041. <tr>
  1042. <td class="parameter_name"><p>format</p></td>
  1043. <td class="parameter_description">
  1044. <p>format string</p>
  1045. <p>Passed as <code class="code">format</code></p>
  1046. </td>
  1047. </tr>
  1048. <tr>
  1049. <td class="parameter_name"><p>date</p></td>
  1050. <td class="parameter_description">
  1051. <p>valid <span class="type">GDate</span></p>
  1052. <p>Passed as <code class="code">date</code></p>
  1053. </td>
  1054. </tr>
  1055. </table></div>
  1056. </div>
  1057. </div>
  1058. <div class="refsect2">
  1059. <a name="id-1.1.10.3.44"></a><h3>date:valid-day?</h3>
  1060. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:valid-day? day))
  1061. </pre></div>
  1062. <p>Returns <code class="constant">TRUE</code> if the day of the month is valid (a day is valid if it's
  1063. between 1 and 31 inclusive).</p>
  1064. <div class="refsect3">
  1065. <a name="id-1.1.10.3.44.4"></a><h4>Parameters</h4>
  1066. <div class="informaltable"><table><tr>
  1067. <td class="parameter_name"><p>day</p></td>
  1068. <td class="parameter_description">
  1069. <p>day to check</p>
  1070. <p>Passed as <code class="code">day</code></p>
  1071. </td>
  1072. </tr></table></div>
  1073. </div>
  1074. </div>
  1075. <div class="refsect2">
  1076. <a name="id-1.1.10.3.45"></a><h3>date:valid-dmy?</h3>
  1077. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:valid-dmy? day month year))
  1078. </pre></div>
  1079. <p>Returns <code class="constant">TRUE</code> if the day-month-year triplet forms a valid, existing day
  1080. in the range of days <span class="type">GDate</span> understands (Year 1 or later, no more than
  1081. a few thousand years in the future).</p>
  1082. <div class="refsect3">
  1083. <a name="id-1.1.10.3.45.4"></a><h4>Parameters</h4>
  1084. <div class="informaltable"><table>
  1085. <tr>
  1086. <td class="parameter_name"><p>day</p></td>
  1087. <td class="parameter_description">
  1088. <p>day</p>
  1089. <p>Passed as <code class="code">day</code></p>
  1090. </td>
  1091. </tr>
  1092. <tr>
  1093. <td class="parameter_name"><p>month</p></td>
  1094. <td class="parameter_description">
  1095. <p>month</p>
  1096. <p>Passed as <code class="code">month</code></p>
  1097. </td>
  1098. </tr>
  1099. <tr>
  1100. <td class="parameter_name"><p>year</p></td>
  1101. <td class="parameter_description">
  1102. <p>year</p>
  1103. <p>Passed as <code class="code">year</code></p>
  1104. </td>
  1105. </tr>
  1106. </table></div>
  1107. </div>
  1108. </div>
  1109. <div class="refsect2">
  1110. <a name="id-1.1.10.3.46"></a><h3>date:valid-julian?</h3>
  1111. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:valid-julian? julian-date))
  1112. </pre></div>
  1113. <p>Returns <code class="constant">TRUE</code> if the Julian day is valid. Anything greater than zero
  1114. is basically a valid Julian, though there is a 32-bit limit.</p>
  1115. <div class="refsect3">
  1116. <a name="id-1.1.10.3.46.4"></a><h4>Parameters</h4>
  1117. <div class="informaltable"><table><tr>
  1118. <td class="parameter_name"><p>julian_date</p></td>
  1119. <td class="parameter_description">
  1120. <p>Julian day to check</p>
  1121. <p>Passed as <code class="code">julian-date</code></p>
  1122. </td>
  1123. </tr></table></div>
  1124. </div>
  1125. </div>
  1126. <div class="refsect2">
  1127. <a name="id-1.1.10.3.47"></a><h3>date:valid-month?</h3>
  1128. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:valid-month? month))
  1129. </pre></div>
  1130. <p>Returns <code class="constant">TRUE</code> if the month value is valid. The 12 <span class="type">GDateMonth</span>
  1131. enumeration values are the only valid months.</p>
  1132. <div class="refsect3">
  1133. <a name="id-1.1.10.3.47.4"></a><h4>Parameters</h4>
  1134. <div class="informaltable"><table><tr>
  1135. <td class="parameter_name"><p>month</p></td>
  1136. <td class="parameter_description">
  1137. <p>month</p>
  1138. <p>Passed as <code class="code">month</code></p>
  1139. </td>
  1140. </tr></table></div>
  1141. </div>
  1142. </div>
  1143. <div class="refsect2">
  1144. <a name="id-1.1.10.3.48"></a><h3>date:valid-weekday?</h3>
  1145. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:valid-weekday? weekday))
  1146. </pre></div>
  1147. <p>Returns <code class="constant">TRUE</code> if the weekday is valid. The seven <span class="type">GDateWeekday</span> enumeration
  1148. values are the only valid weekdays.</p>
  1149. <div class="refsect3">
  1150. <a name="id-1.1.10.3.48.4"></a><h4>Parameters</h4>
  1151. <div class="informaltable"><table><tr>
  1152. <td class="parameter_name"><p>weekday</p></td>
  1153. <td class="parameter_description">
  1154. <p>weekday</p>
  1155. <p>Passed as <code class="code">weekday</code></p>
  1156. </td>
  1157. </tr></table></div>
  1158. </div>
  1159. </div>
  1160. <div class="refsect2">
  1161. <a name="id-1.1.10.3.49"></a><h3>date:valid-year?</h3>
  1162. <div class="informalexample"><pre class="programlisting">(define-values (%return) (date:valid-year? year))
  1163. </pre></div>
  1164. <p>Returns <code class="constant">TRUE</code> if the year is valid. Any year greater than 0 is valid,
  1165. though there is a 16-bit limit to what <span class="type">GDate</span> will understand.</p>
  1166. <div class="refsect3">
  1167. <a name="id-1.1.10.3.49.4"></a><h4>Parameters</h4>
  1168. <div class="informaltable"><table><tr>
  1169. <td class="parameter_name"><p>year</p></td>
  1170. <td class="parameter_description">
  1171. <p>year</p>
  1172. <p>Passed as <code class="code">year</code></p>
  1173. </td>
  1174. </tr></table></div>
  1175. </div>
  1176. </div>
  1177. </div>
  1178. </div>
  1179. <div class="footer">
  1180. <hr>Generated by GTK-Doc V1.33.1</div>
  1181. </body>
  1182. </html>