<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
                      'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd' [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="glib-Date-and-Time-Functions">
<refmeta>
<refentrytitle role="top_of_page" id="glib-Date-and-Time-Functions.top_of_page">Date and Time Functions</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GLIB Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Date and Time Functions</refname>
<refpurpose>calendrical calculations and miscellaneous time stuff</refpurpose>
</refnamediv>

<refsect1 id="glib-Date-and-Time-Functions.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-usleep">g_usleep</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-time-val-add">g_time_val_add</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-time-val-from-iso8601">g_time_val_from_iso8601</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-time-val-to-iso8601">g_time_val_to_iso8601</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-get-monotonic-time">g_get_monotonic_time</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-get-real-time">g_get_real_time</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>



<row><entry role="function_type"><link linkend="GDate"><returnvalue>GDate</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-date-new">g_date_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GDate"><returnvalue>GDate</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-date-new-dmy">g_date_new_dmy</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GDate"><returnvalue>GDate</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-date-new-julian">g_date_new_julian</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-clear">g_date_clear</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-free">g_date_free</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GDate"><returnvalue>GDate</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="g-date-copy">g_date_copy</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-set-day">g_date_set_day</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-set-month">g_date_set_month</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-set-year">g_date_set_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-set-dmy">g_date_set_dmy</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-set-julian">g_date_set_julian</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-set-time">g_date_set_time</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-set-time-t">g_date_set_time_t</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-set-parse">g_date_set_parse</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-add-days">g_date_add_days</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-subtract-days">g_date_subtract_days</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-add-months">g_date_add_months</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-subtract-months">g_date_subtract_months</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-add-years">g_date_add_years</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-subtract-years">g_date_subtract_years</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint"><returnvalue>gint</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-days-between">g_date_days_between</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint"><returnvalue>gint</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-compare">g_date_compare</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-clamp">g_date_clamp</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-order">g_date_order</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="GDateDay"><returnvalue>GDateDay</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-day">g_date_get_day</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GDateMonth"><returnvalue>GDateMonth</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-month">g_date_get_month</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GDateYear"><returnvalue>GDateYear</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-year">g_date_get_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint32"><returnvalue>guint32</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-julian">g_date_get_julian</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GDateWeekday"><returnvalue>GDateWeekday</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-weekday">g_date_get_weekday</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-day-of-year">g_date_get_day_of_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="guint8"><returnvalue>guint8</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-days-in-month">g_date_get_days_in_month</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-is-first-of-month">g_date_is_first_of_month</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-is-last-of-month">g_date_is_last_of_month</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-is-leap-year">g_date_is_leap_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-monday-week-of-year">g_date_get_monday_week_of_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint8"><returnvalue>guint8</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-monday-weeks-in-year">g_date_get_monday_weeks_in_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-sunday-week-of-year">g_date_get_sunday_week_of_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint8"><returnvalue>guint8</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-sunday-weeks-in-year">g_date_get_sunday_weeks_in_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-get-iso8601-week-of-year">g_date_get_iso8601_week_of_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="gsize"><returnvalue>gsize</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-strftime">g_date_strftime</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-to-struct-tm">g_date_to_struct_tm</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-valid">g_date_valid</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-valid-day">g_date_valid_day</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-valid-month">g_date_valid_month</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-valid-year">g_date_valid_year</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-valid-dmy">g_date_valid_dmy</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-valid-julian">g_date_valid_julian</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="g-date-valid-weekday">g_date_valid_weekday</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="glib-Date-and-Time-Functions.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-USEC-PER-SEC:CAPS">G_USEC_PER_SEC</link></entry></row>


<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GDate">GDate</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GDateDMY">GDateDMY</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="GDateDay">GDateDay</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GDateMonth">GDateMonth</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="GDateYear">GDateYear</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GDateWeekday">GDateWeekday</link></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-DATE-BAD-DAY:CAPS">G_DATE_BAD_DAY</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-DATE-BAD-JULIAN:CAPS">G_DATE_BAD_JULIAN</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-DATE-BAD-YEAR:CAPS">G_DATE_BAD_YEAR</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 id="glib-Date-and-Time-Functions.includes"><title>Includes</title><synopsis>#include &lt;glib.h&gt;
#include &lt;glib/gprintf.h&gt;
</synopsis></refsect1>

<refsect1 id="glib-Date-and-Time-Functions.description" role="desc">
<title role="desc.title">Description</title>
<para>The <link linkend="GDate"><type>GDate</type></link> data structure represents a day between January 1, Year 1,
and sometime a few thousand years in the future (right now it will go
to the year 65535 or so, but <link linkend="g-date-set-parse"><function>g_date_set_parse()</function></link> only parses up to the
year 8000 or so - just count on "a few thousand"). <link linkend="GDate"><type>GDate</type></link> is meant to
represent everyday dates, not astronomical dates or historical dates
or ISO timestamps or the like. It extrapolates the current Gregorian
calendar forward and backward in time; there is no attempt to change
the calendar to match time periods or locations. <link linkend="GDate"><type>GDate</type></link> does not store
time information; it represents a day.</para>
<para>The <link linkend="GDate"><type>GDate</type></link> implementation has several nice features; it is only a
64-bit struct, so storing large numbers of dates is very efficient. It
can keep both a Julian and day-month-year representation of the date,
since some calculations are much easier with one representation or the
other. A Julian representation is simply a count of days since some
fixed day in the past; for <link linkend="GDate"><type>GDate</type></link> the fixed day is January 1, 1 AD.
("Julian" dates in the <link linkend="GDate"><type>GDate</type></link> API aren't really Julian dates in the
technical sense; technically, Julian dates count from the start of the
Julian period, Jan 1, 4713 BC).</para>
<para><link linkend="GDate"><type>GDate</type></link> is simple to use. First you need a "blank" date; you can get a
dynamically allocated date from <link linkend="g-date-new"><function>g_date_new()</function></link>, or you can declare an
automatic variable or array and initialize it to a sane state by
calling <link linkend="g-date-clear"><function>g_date_clear()</function></link>. A cleared date is sane; it's safe to call
<link linkend="g-date-set-dmy"><function>g_date_set_dmy()</function></link> and the other mutator functions to initialize the
value of a cleared date. However, a cleared date is initially
invalid, meaning that it doesn't represent a day that exists.
It is undefined to call any of the date calculation routines on an
invalid date. If you obtain a date from a user or other
unpredictable source, you should check its validity with the
<link linkend="g-date-valid"><function>g_date_valid()</function></link> predicate. <link linkend="g-date-valid"><function>g_date_valid()</function></link> is also used to check for
errors with <link linkend="g-date-set-parse"><function>g_date_set_parse()</function></link> and other functions that can
fail. Dates can be invalidated by calling <link linkend="g-date-clear"><function>g_date_clear()</function></link> again.</para>
<para>It is very important to use the API to access the <link linkend="GDate"><type>GDate</type></link>
struct. Often only the day-month-year or only the Julian
representation is valid. Sometimes neither is valid. Use the API.</para>
<para>GLib also features <link linkend="GDateTime"><type>GDateTime</type></link> which represents a precise time.</para>

</refsect1>
<refsect1 id="glib-Date-and-Time-Functions.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="g-usleep" role="function">
<title>g_usleep&#160;()</title>
<indexterm zone="g-usleep"><primary sortas="usleep">g_usleep</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_usleep (<parameter><link linkend="gulong"><type>gulong</type></link> microseconds</parameter>);</programlisting>
<para>Pauses the current thread for the given number of microseconds.</para>
<para>There are 1 million microseconds per second (represented by the
<link linkend="G-USEC-PER-SEC:CAPS"><type>G_USEC_PER_SEC</type></link> macro). <link linkend="g-usleep"><function>g_usleep()</function></link> may have limited precision,
depending on hardware and operating system; don't rely on the exact
length of the sleep.</para>
<refsect3 id="g-usleep.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>microseconds</para></entry>
<entry role="parameter_description"><para>number of microseconds to pause</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-time-val-add" role="function" condition="deprecated">
<title>g_time_val_add&#160;()</title>
<indexterm zone="g-time-val-add" role="deprecated"><primary sortas="time_val_add">g_time_val_add</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_time_val_add (<parameter><link linkend="GTimeVal"><type>GTimeVal</type></link> *time_</parameter>,
                <parameter><link linkend="glong"><type>glong</type></link> microseconds</parameter>);</programlisting>
<warning><para><literal>g_time_val_add</literal> has been deprecated since version 2.62 and should not be used in newly-written code.</para> <para><link linkend="GTimeVal"><type>GTimeVal</type></link> is not year-2038-safe. Use <literal>guint64</literal> for
   representing microseconds since the epoch, or use <link linkend="GDateTime"><type>GDateTime</type></link>.</para>
</warning>
<para>Adds the given number of microseconds to <parameter>time_</parameter>
. <parameter>microseconds</parameter>
 can
also be negative to decrease the value of <parameter>time_</parameter>
.</para>
<refsect3 id="g-time-val-add.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>time_</para></entry>
<entry role="parameter_description"><para>a <link linkend="GTimeVal"><type>GTimeVal</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>microseconds</para></entry>
<entry role="parameter_description"><para>number of microseconds to add to <parameter>time</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-time-val-from-iso8601" role="function" condition="deprecated|since:2.12">
<title>g_time_val_from_iso8601&#160;()</title>
<indexterm zone="g-time-val-from-iso8601" role="deprecated"><primary sortas="time_val_from_iso8601">g_time_val_from_iso8601</primary></indexterm><indexterm zone="g-time-val-from-iso8601" role="2.12"><primary sortas="time_val_from_iso8601">g_time_val_from_iso8601</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_time_val_from_iso8601 (<parameter>const <link linkend="gchar"><type>gchar</type></link> *iso_date</parameter>,
                         <parameter><link linkend="GTimeVal"><type>GTimeVal</type></link> *time_</parameter>);</programlisting>
<warning><para><literal>g_time_val_from_iso8601</literal> has been deprecated since version 2.62 and should not be used in newly-written code.</para> <para><link linkend="GTimeVal"><type>GTimeVal</type></link> is not year-2038-safe. Use
   <link linkend="g-date-time-new-from-iso8601"><function>g_date_time_new_from_iso8601()</function></link> instead.</para>
</warning>
<para>Converts a string containing an ISO 8601 encoded date and time
to a <link linkend="GTimeVal"><type>GTimeVal</type></link> and puts it into <parameter>time_</parameter>
.</para>
<para><parameter>iso_date</parameter>
 must include year, month, day, hours, minutes, and
seconds. It can optionally include fractions of a second and a time
zone indicator. (In the absence of any time zone indication, the
timestamp is assumed to be in local time.)</para>
<para>Any leading or trailing space in <parameter>iso_date</parameter>
 is ignored.</para>
<para>This function was deprecated, along with <link linkend="GTimeVal"><type>GTimeVal</type></link> itself, in GLib 2.62.
Equivalent functionality is available using code like:</para>
<informalexample><programlisting role="example"><![CDATA[
GDateTime *dt = g_date_time_new_from_iso8601 (iso8601_string, NULL);
gint64 time_val = g_date_time_to_unix (dt);
g_date_time_unref (dt);
]]></programlisting></informalexample>
<para></para>
<refsect3 id="g-time-val-from-iso8601.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>iso_date</para></entry>
<entry role="parameter_description"><para>an ISO 8601 encoded date string</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>time_</para></entry>
<entry role="parameter_description"><para>a <link linkend="GTimeVal"><type>GTimeVal</type></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-time-val-from-iso8601.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the conversion was successful.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.12">2.12</link></para></refsect2>
<refsect2 id="g-time-val-to-iso8601" role="function" condition="deprecated|since:2.12">
<title>g_time_val_to_iso8601&#160;()</title>
<indexterm zone="g-time-val-to-iso8601" role="deprecated"><primary sortas="time_val_to_iso8601">g_time_val_to_iso8601</primary></indexterm><indexterm zone="g-time-val-to-iso8601" role="2.12"><primary sortas="time_val_to_iso8601">g_time_val_to_iso8601</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
g_time_val_to_iso8601 (<parameter><link linkend="GTimeVal"><type>GTimeVal</type></link> *time_</parameter>);</programlisting>
<warning><para><literal>g_time_val_to_iso8601</literal> has been deprecated since version 2.62 and should not be used in newly-written code.</para> <para><link linkend="GTimeVal"><type>GTimeVal</type></link> is not year-2038-safe. Use
   g_date_time_format_iso8601(dt) instead.</para>
</warning>
<para>Converts <parameter>time_</parameter>
 into an RFC 3339 encoded string, relative to the
Coordinated Universal Time (UTC). This is one of the many formats
allowed by ISO 8601.</para>
<para>ISO 8601 allows a large number of date/time formats, with or without
punctuation and optional elements. The format returned by this function
is a complete date and time, with optional punctuation included, the
UTC time zone represented as "Z", and the <parameter>tv_usec</parameter>
 part included if
and only if it is nonzero, i.e. either
"YYYY-MM-DDTHH:MM:SSZ" or "YYYY-MM-DDTHH:MM:SS.fffffZ".</para>
<para>This corresponds to the Internet date/time format defined by
<ulink url="https://www.ietf.org/rfc/rfc3339.txt">RFC 3339</ulink>,
and to either of the two most-precise formats defined by
the W3C Note
<ulink url="http://www.w3.org/TR/NOTE-datetime-19980827">Date and Time Formats</ulink>.
Both of these documents are profiles of ISO 8601.</para>
<para>Use <link linkend="g-date-time-format"><function>g_date_time_format()</function></link> or <link linkend="g-strdup-printf"><function>g_strdup_printf()</function></link> if a different
variation of ISO 8601 format is required.</para>
<para>If <parameter>time_</parameter>
 represents a date which is too large to fit into a <literal>struct tm</literal>,
<link linkend="NULL:CAPS"><literal>NULL</literal></link> will be returned. This is platform dependent. Note also that since
<literal>GTimeVal</literal> stores the number of seconds as a <literal>glong</literal>, on 32-bit systems it
is subject to the year 2038 problem. Accordingly, since GLib 2.62, this
function has been deprecated. Equivalent functionality is available using:</para>
<informalexample><programlisting role="example"><![CDATA[
GDateTime *dt = g_date_time_new_from_unix_utc (time_val);
iso8601_string = g_date_time_format_iso8601 (dt);
g_date_time_unref (dt);
]]></programlisting></informalexample>
<para></para>
<para>The return value of <link linkend="g-time-val-to-iso8601"><function>g_time_val_to_iso8601()</function></link> has been nullable since GLib
2.54; before then, GLib would crash under the same conditions.</para>
<refsect3 id="g-time-val-to-iso8601.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>time_</para></entry>
<entry role="parameter_description"><para>a <link linkend="GTimeVal"><type>GTimeVal</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-time-val-to-iso8601.returns" role="returns">
<title>Returns</title>
<para>a newly allocated string containing an ISO 8601 date,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if <parameter>time_</parameter>
was too large. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.12">2.12</link></para></refsect2>
<refsect2 id="g-get-monotonic-time" role="function" condition="since:2.28">
<title>g_get_monotonic_time&#160;()</title>
<indexterm zone="g-get-monotonic-time" role="2.28"><primary sortas="get_monotonic_time">g_get_monotonic_time</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
g_get_monotonic_time (<parameter><type>void</type></parameter>);</programlisting>
<para>Queries the system monotonic time.</para>
<para>The monotonic clock will always increase and doesn't suffer
discontinuities when the user (or NTP) changes the system time.  It
may or may not continue to tick during times where the machine is
suspended.</para>
<para>We try to use the clock that corresponds as closely as possible to
the passage of time as measured by system calls such as <link linkend="poll"><function>poll()</function></link> but it
may not always be possible to do this.</para>
<refsect3 id="g-get-monotonic-time.returns" role="returns">
<title>Returns</title>
<para> the monotonic time, in microseconds</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.28">2.28</link></para></refsect2>
<refsect2 id="g-get-real-time" role="function" condition="since:2.28">
<title>g_get_real_time&#160;()</title>
<indexterm zone="g-get-real-time" role="2.28"><primary sortas="get_real_time">g_get_real_time</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
g_get_real_time (<parameter><type>void</type></parameter>);</programlisting>
<para>Queries the system wall-clock time.</para>
<para>This call is functionally equivalent to <link linkend="g-get-current-time"><function>g_get_current_time()</function></link> except
that the return value is often more convenient than dealing with a
<link linkend="GTimeVal"><type>GTimeVal</type></link>.</para>
<para>You should only use this call if you are actually interested in the real
wall-clock time.  <link linkend="g-get-monotonic-time"><function>g_get_monotonic_time()</function></link> is probably more useful for
measuring intervals.</para>
<refsect3 id="g-get-real-time.returns" role="returns">
<title>Returns</title>
<para> the number of microseconds since January 1, 1970 UTC.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.28">2.28</link></para></refsect2>
<refsect2 id="g-date-new" role="function">
<title>g_date_new&#160;()</title>
<indexterm zone="g-date-new"><primary sortas="date_new">g_date_new</primary></indexterm>
<programlisting language="C"><link linkend="GDate"><returnvalue>GDate</returnvalue></link>&#160;*
g_date_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Allocates a <link linkend="GDate"><type>GDate</type></link> and initializes
it to a sane state. The new date will
be cleared (as if you'd called <link linkend="g-date-clear"><function>g_date_clear()</function></link>) but invalid (it won't
represent an existing day). Free the return value with <link linkend="g-date-free"><function>g_date_free()</function></link>.</para>
<refsect3 id="g-date-new.returns" role="returns">
<title>Returns</title>
<para> a newly-allocated <link linkend="GDate"><type>GDate</type></link></para>
</refsect3></refsect2>
<refsect2 id="g-date-new-dmy" role="function">
<title>g_date_new_dmy&#160;()</title>
<indexterm zone="g-date-new-dmy"><primary sortas="date_new_dmy">g_date_new_dmy</primary></indexterm>
<programlisting language="C"><link linkend="GDate"><returnvalue>GDate</returnvalue></link>&#160;*
g_date_new_dmy (<parameter><link linkend="GDateDay"><type>GDateDay</type></link> day</parameter>,
                <parameter><link linkend="GDateMonth"><type>GDateMonth</type></link> month</parameter>,
                <parameter><link linkend="GDateYear"><type>GDateYear</type></link> year</parameter>);</programlisting>
<para>Like <link linkend="g-date-new"><function>g_date_new()</function></link>, but also sets the value of the date. Assuming the
day-month-year triplet you pass in represents an existing day, the
returned date will be valid.</para>
<refsect3 id="g-date-new-dmy.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>day</para></entry>
<entry role="parameter_description"><para>day of the month</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>month</para></entry>
<entry role="parameter_description"><para>month of the year</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>year</para></entry>
<entry role="parameter_description"><para>year</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-new-dmy.returns" role="returns">
<title>Returns</title>
<para> a newly-allocated <link linkend="GDate"><type>GDate</type></link> initialized with <parameter>day</parameter>
, <parameter>month</parameter>
, and <parameter>year</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="g-date-new-julian" role="function">
<title>g_date_new_julian&#160;()</title>
<indexterm zone="g-date-new-julian"><primary sortas="date_new_julian">g_date_new_julian</primary></indexterm>
<programlisting language="C"><link linkend="GDate"><returnvalue>GDate</returnvalue></link>&#160;*
g_date_new_julian (<parameter><link linkend="guint32"><type>guint32</type></link> julian_day</parameter>);</programlisting>
<para>Like <link linkend="g-date-new"><function>g_date_new()</function></link>, but also sets the value of the date. Assuming the
Julian day number you pass in is valid (greater than 0, less than an
unreasonably large number), the returned date will be valid.</para>
<refsect3 id="g-date-new-julian.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>julian_day</para></entry>
<entry role="parameter_description"><para>days since January 1, Year 1</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-new-julian.returns" role="returns">
<title>Returns</title>
<para> a newly-allocated <link linkend="GDate"><type>GDate</type></link> initialized with <parameter>julian_day</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="g-date-clear" role="function">
<title>g_date_clear&#160;()</title>
<indexterm zone="g-date-clear"><primary sortas="date_clear">g_date_clear</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_clear (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
              <parameter><link linkend="guint"><type>guint</type></link> n_dates</parameter>);</programlisting>
<para>Initializes one or more <link linkend="GDate"><type>GDate</type></link> structs to a sane but invalid
state. The cleared dates will not represent an existing date, but will
not contain garbage. Useful to init a date declared on the stack.
Validity can be tested with <link linkend="g-date-valid"><function>g_date_valid()</function></link>.</para>
<refsect3 id="g-date-clear.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>pointer to one or more dates to clear</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_dates</para></entry>
<entry role="parameter_description"><para>number of dates to clear</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-free" role="function">
<title>g_date_free&#160;()</title>
<indexterm zone="g-date-free"><primary sortas="date_free">g_date_free</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_free (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Frees a <link linkend="GDate"><type>GDate</type></link> returned from <link linkend="g-date-new"><function>g_date_new()</function></link>.</para>
<refsect3 id="g-date-free.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to free</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-copy" role="function" condition="since:2.56">
<title>g_date_copy&#160;()</title>
<indexterm zone="g-date-copy" role="2.56"><primary sortas="date_copy">g_date_copy</primary></indexterm>
<programlisting language="C"><link linkend="GDate"><returnvalue>GDate</returnvalue></link>&#160;*
g_date_copy (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Copies a GDate to a newly-allocated GDate. If the input was invalid
(as determined by <link linkend="g-date-valid"><function>g_date_valid()</function></link>), the invalid state will be copied
as is into the new object.</para>
<refsect3 id="g-date-copy.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to copy</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-copy.returns" role="returns">
<title>Returns</title>
<para>a newly-allocated <link linkend="GDate"><type>GDate</type></link> initialized from <parameter>date</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3><para role="since">Since: <link linkend="api-index-2.56">2.56</link></para></refsect2>
<refsect2 id="g-date-set-day" role="function">
<title>g_date_set_day&#160;()</title>
<indexterm zone="g-date-set-day"><primary sortas="date_set_day">g_date_set_day</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_set_day (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                <parameter><link linkend="GDateDay"><type>GDateDay</type></link> day</parameter>);</programlisting>
<para>Sets the day of the month for a <link linkend="GDate"><type>GDate</type></link>. If the resulting
day-month-year triplet is invalid, the date will be invalid.</para>
<refsect3 id="g-date-set-day.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>day</para></entry>
<entry role="parameter_description"><para>day to set</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-set-month" role="function">
<title>g_date_set_month&#160;()</title>
<indexterm zone="g-date-set-month"><primary sortas="date_set_month">g_date_set_month</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_set_month (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                  <parameter><link linkend="GDateMonth"><type>GDateMonth</type></link> month</parameter>);</programlisting>
<para>Sets the month of the year for a <link linkend="GDate"><type>GDate</type></link>.  If the resulting
day-month-year triplet is invalid, the date will be invalid.</para>
<refsect3 id="g-date-set-month.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>month</para></entry>
<entry role="parameter_description"><para>month to set</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-set-year" role="function">
<title>g_date_set_year&#160;()</title>
<indexterm zone="g-date-set-year"><primary sortas="date_set_year">g_date_set_year</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_set_year (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                 <parameter><link linkend="GDateYear"><type>GDateYear</type></link> year</parameter>);</programlisting>
<para>Sets the year for a <link linkend="GDate"><type>GDate</type></link>. If the resulting day-month-year
triplet is invalid, the date will be invalid.</para>
<refsect3 id="g-date-set-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>year</para></entry>
<entry role="parameter_description"><para>year to set</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-set-dmy" role="function">
<title>g_date_set_dmy&#160;()</title>
<indexterm zone="g-date-set-dmy"><primary sortas="date_set_dmy">g_date_set_dmy</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_set_dmy (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                <parameter><link linkend="GDateDay"><type>GDateDay</type></link> day</parameter>,
                <parameter><link linkend="GDateMonth"><type>GDateMonth</type></link> month</parameter>,
                <parameter><link linkend="GDateYear"><type>GDateYear</type></link> y</parameter>);</programlisting>
<para>Sets the value of a <link linkend="GDate"><type>GDate</type></link> from a day, month, and year.
The day-month-year triplet must be valid; if you aren't
sure it is, call <link linkend="g-date-valid-dmy"><function>g_date_valid_dmy()</function></link> to check before you
set it.</para>
<refsect3 id="g-date-set-dmy.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>day</para></entry>
<entry role="parameter_description"><para>day</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>month</para></entry>
<entry role="parameter_description"><para>month</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>y</para></entry>
<entry role="parameter_description"><para>year</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-set-julian" role="function">
<title>g_date_set_julian&#160;()</title>
<indexterm zone="g-date-set-julian"><primary sortas="date_set_julian">g_date_set_julian</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_set_julian (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                   <parameter><link linkend="guint32"><type>guint32</type></link> julian_date</parameter>);</programlisting>
<para>Sets the value of a <link linkend="GDate"><type>GDate</type></link> from a Julian day number.</para>
<refsect3 id="g-date-set-julian.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>julian_date</para></entry>
<entry role="parameter_description"><para>Julian day number (days since January 1, Year 1)</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-set-time" role="function" condition="deprecated:2.10: Use g_date_set_time_t() instead.">
<title>g_date_set_time&#160;()</title>
<indexterm zone="g-date-set-time" role="deprecated"><primary sortas="date_set_time">g_date_set_time</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_set_time (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                 <parameter><link linkend="GTime"><type>GTime</type></link> time_</parameter>);</programlisting>
<warning><para><literal>g_date_set_time</literal> has been deprecated since version 2.10 and should not be used in newly-written code.</para> <para>Use <link linkend="g-date-set-time-t"><function>g_date_set_time_t()</function></link> instead.</para>
</warning>
<para>Sets the value of a date from a <link linkend="GTime"><type>GTime</type></link> value.
The time to date conversion is done using the user's current timezone.</para>
<refsect3 id="g-date-set-time.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>time_</para></entry>
<entry role="parameter_description"><para><link linkend="GTime"><type>GTime</type></link> value to set.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-set-time-t" role="function" condition="since:2.10">
<title>g_date_set_time_t&#160;()</title>
<indexterm zone="g-date-set-time-t" role="2.10"><primary sortas="date_set_time_t">g_date_set_time_t</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_set_time_t (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                   <parameter><link linkend="time-t"><type>time_t</type></link> timet</parameter>);</programlisting>
<para>Sets the value of a date to the date corresponding to a time 
specified as a time_t. The time to date conversion is done using 
the user's current timezone.</para>
<para>To set the value of a date to the current day, you could write:</para>
<informalexample><programlisting role="example"><![CDATA[
 time_t now = time (NULL);
 if (now == (time_t) -1)
   // handle the error
 g_date_set_time_t (date, now);
]]></programlisting></informalexample>
<para></para>
<refsect3 id="g-date-set-time-t.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> </para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>timet</para></entry>
<entry role="parameter_description"><para>time_t value to set</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.10">2.10</link></para></refsect2>
<refsect2 id="g-date-set-parse" role="function">
<title>g_date_set_parse&#160;()</title>
<indexterm zone="g-date-set-parse"><primary sortas="date_set_parse">g_date_set_parse</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_set_parse (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                  <parameter>const <link linkend="gchar"><type>gchar</type></link> *str</parameter>);</programlisting>
<para>Parses a user-inputted string <parameter>str</parameter>
, and try to figure out what date it
represents, taking the <link linkend="setlocale">current locale</link> into account. If the
string is successfully parsed, the date will be valid after the call.
Otherwise, it will be invalid. You should check using <link linkend="g-date-valid"><function>g_date_valid()</function></link>
to see whether the parsing succeeded.</para>
<para>This function is not appropriate for file formats and the like; it
isn't very precise, and its exact behavior varies with the locale.
It's intended to be a heuristic routine that guesses what the user
means by a given string (and it does work pretty well in that
capacity).</para>
<refsect3 id="g-date-set-parse.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to fill in</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>string to parse</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-add-days" role="function">
<title>g_date_add_days&#160;()</title>
<indexterm zone="g-date-add-days"><primary sortas="date_add_days">g_date_add_days</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_add_days (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                 <parameter><link linkend="guint"><type>guint</type></link> n_days</parameter>);</programlisting>
<para>Increments a date some number of days.
To move forward by weeks, add weeks*7 days.
The date must be valid.</para>
<refsect3 id="g-date-add-days.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to increment</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_days</para></entry>
<entry role="parameter_description"><para>number of days to move the date forward</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-subtract-days" role="function">
<title>g_date_subtract_days&#160;()</title>
<indexterm zone="g-date-subtract-days"><primary sortas="date_subtract_days">g_date_subtract_days</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_subtract_days (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                      <parameter><link linkend="guint"><type>guint</type></link> n_days</parameter>);</programlisting>
<para>Moves a date some number of days into the past.
To move by weeks, just move by weeks*7 days.
The date must be valid.</para>
<refsect3 id="g-date-subtract-days.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to decrement</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_days</para></entry>
<entry role="parameter_description"><para>number of days to move</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-add-months" role="function">
<title>g_date_add_months&#160;()</title>
<indexterm zone="g-date-add-months"><primary sortas="date_add_months">g_date_add_months</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_add_months (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                   <parameter><link linkend="guint"><type>guint</type></link> n_months</parameter>);</programlisting>
<para>Increments a date by some number of months.
If the day of the month is greater than 28,
this routine may change the day of the month
(because the destination month may not have
the current day in it). The date must be valid.</para>
<refsect3 id="g-date-add-months.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to increment</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_months</para></entry>
<entry role="parameter_description"><para>number of months to move forward</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-subtract-months" role="function">
<title>g_date_subtract_months&#160;()</title>
<indexterm zone="g-date-subtract-months"><primary sortas="date_subtract_months">g_date_subtract_months</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_subtract_months (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                        <parameter><link linkend="guint"><type>guint</type></link> n_months</parameter>);</programlisting>
<para>Moves a date some number of months into the past.
If the current day of the month doesn't exist in
the destination month, the day of the month
may change. The date must be valid.</para>
<refsect3 id="g-date-subtract-months.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to decrement</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_months</para></entry>
<entry role="parameter_description"><para>number of months to move</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-add-years" role="function">
<title>g_date_add_years&#160;()</title>
<indexterm zone="g-date-add-years"><primary sortas="date_add_years">g_date_add_years</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_add_years (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                  <parameter><link linkend="guint"><type>guint</type></link> n_years</parameter>);</programlisting>
<para>Increments a date by some number of years.
If the date is February 29, and the destination
year is not a leap year, the date will be changed
to February 28. The date must be valid.</para>
<refsect3 id="g-date-add-years.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to increment</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_years</para></entry>
<entry role="parameter_description"><para>number of years to move forward</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-subtract-years" role="function">
<title>g_date_subtract_years&#160;()</title>
<indexterm zone="g-date-subtract-years"><primary sortas="date_subtract_years">g_date_subtract_years</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_subtract_years (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                       <parameter><link linkend="guint"><type>guint</type></link> n_years</parameter>);</programlisting>
<para>Moves a date some number of years into the past.
If the current day doesn't exist in the destination
year (i.e. it's February 29 and you move to a non-leap-year)
then the day is changed to February 29. The date
must be valid.</para>
<refsect3 id="g-date-subtract-years.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to decrement</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_years</para></entry>
<entry role="parameter_description"><para>number of years to move</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-days-between" role="function">
<title>g_date_days_between&#160;()</title>
<indexterm zone="g-date-days-between"><primary sortas="date_days_between">g_date_days_between</primary></indexterm>
<programlisting language="C"><link linkend="gint"><returnvalue>gint</returnvalue></link>
g_date_days_between (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date1</parameter>,
                     <parameter>const <link linkend="GDate"><type>GDate</type></link> *date2</parameter>);</programlisting>
<para>Computes the number of days between two dates.
If <parameter>date2</parameter>
 is prior to <parameter>date1</parameter>
, the returned value is negative.
Both dates must be valid.</para>
<refsect3 id="g-date-days-between.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date1</para></entry>
<entry role="parameter_description"><para>the first date</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>date2</para></entry>
<entry role="parameter_description"><para>the second date</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-days-between.returns" role="returns">
<title>Returns</title>
<para> the number of days between <parameter>date1</parameter>
and <parameter>date2</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="g-date-compare" role="function">
<title>g_date_compare&#160;()</title>
<indexterm zone="g-date-compare"><primary sortas="date_compare">g_date_compare</primary></indexterm>
<programlisting language="C"><link linkend="gint"><returnvalue>gint</returnvalue></link>
g_date_compare (<parameter>const <link linkend="GDate"><type>GDate</type></link> *lhs</parameter>,
                <parameter>const <link linkend="GDate"><type>GDate</type></link> *rhs</parameter>);</programlisting>
<para>qsort()-style comparison function for dates.
Both dates must be valid.</para>
<refsect3 id="g-date-compare.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>lhs</para></entry>
<entry role="parameter_description"><para>first date to compare</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>rhs</para></entry>
<entry role="parameter_description"><para>second date to compare</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-compare.returns" role="returns">
<title>Returns</title>
<para> 0 for equal, less than zero if <parameter>lhs</parameter>
is less than <parameter>rhs</parameter>
,
greater than zero if <parameter>lhs</parameter>
is greater than <parameter>rhs</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="g-date-clamp" role="function">
<title>g_date_clamp&#160;()</title>
<indexterm zone="g-date-clamp"><primary sortas="date_clamp">g_date_clamp</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_clamp (<parameter><link linkend="GDate"><type>GDate</type></link> *date</parameter>,
              <parameter>const <link linkend="GDate"><type>GDate</type></link> *min_date</parameter>,
              <parameter>const <link linkend="GDate"><type>GDate</type></link> *max_date</parameter>);</programlisting>
<para>If <parameter>date</parameter>
 is prior to <parameter>min_date</parameter>
, sets <parameter>date</parameter>
 equal to <parameter>min_date</parameter>
.
If <parameter>date</parameter>
 falls after <parameter>max_date</parameter>
, sets <parameter>date</parameter>
 equal to <parameter>max_date</parameter>
.
Otherwise, <parameter>date</parameter>
 is unchanged.
Either of <parameter>min_date</parameter>
 and <parameter>max_date</parameter>
 may be <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
All non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> dates must be valid.</para>
<refsect3 id="g-date-clamp.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to clamp</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>min_date</para></entry>
<entry role="parameter_description"><para>minimum accepted value for <parameter>date</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>max_date</para></entry>
<entry role="parameter_description"><para>maximum accepted value for <parameter>date</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-order" role="function">
<title>g_date_order&#160;()</title>
<indexterm zone="g-date-order"><primary sortas="date_order">g_date_order</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_order (<parameter><link linkend="GDate"><type>GDate</type></link> *date1</parameter>,
              <parameter><link linkend="GDate"><type>GDate</type></link> *date2</parameter>);</programlisting>
<para>Checks if <parameter>date1</parameter>
 is less than or equal to <parameter>date2</parameter>
,
and swap the values if this is not the case.</para>
<refsect3 id="g-date-order.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date1</para></entry>
<entry role="parameter_description"><para>the first date</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>date2</para></entry>
<entry role="parameter_description"><para>the second date</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-get-day" role="function">
<title>g_date_get_day&#160;()</title>
<indexterm zone="g-date-get-day"><primary sortas="date_get_day">g_date_get_day</primary></indexterm>
<programlisting language="C"><link linkend="GDateDay"><returnvalue>GDateDay</returnvalue></link>
g_date_get_day (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns the day of the month. The date must be valid.</para>
<refsect3 id="g-date-get-day.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to extract the day of the month from</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-day.returns" role="returns">
<title>Returns</title>
<para> day of the month</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-month" role="function">
<title>g_date_get_month&#160;()</title>
<indexterm zone="g-date-get-month"><primary sortas="date_get_month">g_date_get_month</primary></indexterm>
<programlisting language="C"><link linkend="GDateMonth"><returnvalue>GDateMonth</returnvalue></link>
g_date_get_month (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns the month of the year. The date must be valid.</para>
<refsect3 id="g-date-get-month.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to get the month from</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-month.returns" role="returns">
<title>Returns</title>
<para> month of the year as a <link linkend="GDateMonth"><type>GDateMonth</type></link></para>
</refsect3></refsect2>
<refsect2 id="g-date-get-year" role="function">
<title>g_date_get_year&#160;()</title>
<indexterm zone="g-date-get-year"><primary sortas="date_get_year">g_date_get_year</primary></indexterm>
<programlisting language="C"><link linkend="GDateYear"><returnvalue>GDateYear</returnvalue></link>
g_date_get_year (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns the year of a <link linkend="GDate"><type>GDate</type></link>. The date must be valid.</para>
<refsect3 id="g-date-get-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-year.returns" role="returns">
<title>Returns</title>
<para> year in which the date falls</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-julian" role="function">
<title>g_date_get_julian&#160;()</title>
<indexterm zone="g-date-get-julian"><primary sortas="date_get_julian">g_date_get_julian</primary></indexterm>
<programlisting language="C"><link linkend="guint32"><returnvalue>guint32</returnvalue></link>
g_date_get_julian (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns the Julian day or "serial number" of the <link linkend="GDate"><type>GDate</type></link>. The
Julian day is simply the number of days since January 1, Year 1; i.e.,
January 1, Year 1 is Julian day 1; January 2, Year 1 is Julian day 2,
etc. The date must be valid.</para>
<refsect3 id="g-date-get-julian.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to extract the Julian day from</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-julian.returns" role="returns">
<title>Returns</title>
<para> Julian day</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-weekday" role="function">
<title>g_date_get_weekday&#160;()</title>
<indexterm zone="g-date-get-weekday"><primary sortas="date_get_weekday">g_date_get_weekday</primary></indexterm>
<programlisting language="C"><link linkend="GDateWeekday"><returnvalue>GDateWeekday</returnvalue></link>
g_date_get_weekday (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns the day of the week for a <link linkend="GDate"><type>GDate</type></link>. The date must be valid.</para>
<refsect3 id="g-date-get-weekday.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-weekday.returns" role="returns">
<title>Returns</title>
<para> day of the week as a <link linkend="GDateWeekday"><type>GDateWeekday</type></link>.</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-day-of-year" role="function">
<title>g_date_get_day_of_year&#160;()</title>
<indexterm zone="g-date-get-day-of-year"><primary sortas="date_get_day_of_year">g_date_get_day_of_year</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
g_date_get_day_of_year (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns the day of the year, where Jan 1 is the first day of the
year. The date must be valid.</para>
<refsect3 id="g-date-get-day-of-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to extract day of year from</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-day-of-year.returns" role="returns">
<title>Returns</title>
<para> day of the year</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-days-in-month" role="function">
<title>g_date_get_days_in_month&#160;()</title>
<indexterm zone="g-date-get-days-in-month"><primary sortas="date_get_days_in_month">g_date_get_days_in_month</primary></indexterm>
<programlisting language="C"><link linkend="guint8"><returnvalue>guint8</returnvalue></link>
g_date_get_days_in_month (<parameter><link linkend="GDateMonth"><type>GDateMonth</type></link> month</parameter>,
                          <parameter><link linkend="GDateYear"><type>GDateYear</type></link> year</parameter>);</programlisting>
<para>Returns the number of days in a month, taking leap
years into account.</para>
<refsect3 id="g-date-get-days-in-month.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>month</para></entry>
<entry role="parameter_description"><para>month</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>year</para></entry>
<entry role="parameter_description"><para>year</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-days-in-month.returns" role="returns">
<title>Returns</title>
<para> number of days in <parameter>month</parameter>
during the <parameter>year</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="g-date-is-first-of-month" role="function">
<title>g_date_is_first_of_month&#160;()</title>
<indexterm zone="g-date-is-first-of-month"><primary sortas="date_is_first_of_month">g_date_is_first_of_month</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_is_first_of_month (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the date is on the first of a month.
The date must be valid.</para>
<refsect3 id="g-date-is-first-of-month.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to check</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-is-first-of-month.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the date is the first of the month</para>
</refsect3></refsect2>
<refsect2 id="g-date-is-last-of-month" role="function">
<title>g_date_is_last_of_month&#160;()</title>
<indexterm zone="g-date-is-last-of-month"><primary sortas="date_is_last_of_month">g_date_is_last_of_month</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_is_last_of_month (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the date is the last day of the month.
The date must be valid.</para>
<refsect3 id="g-date-is-last-of-month.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to check</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-is-last-of-month.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the date is the last day of the month</para>
</refsect3></refsect2>
<refsect2 id="g-date-is-leap-year" role="function">
<title>g_date_is_leap_year&#160;()</title>
<indexterm zone="g-date-is-leap-year"><primary sortas="date_is_leap_year">g_date_is_leap_year</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_is_leap_year (<parameter><link linkend="GDateYear"><type>GDateYear</type></link> year</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the year is a leap year.</para>
<para>For the purposes of this function, leap year is every year
divisible by 4 unless that year is divisible by 100. If it
is divisible by 100 it would be a leap year only if that year
is also divisible by 400.</para>
<refsect3 id="g-date-is-leap-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>year</para></entry>
<entry role="parameter_description"><para>year to check</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-is-leap-year.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the year is a leap year</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-monday-week-of-year" role="function">
<title>g_date_get_monday_week_of_year&#160;()</title>
<indexterm zone="g-date-get-monday-week-of-year"><primary sortas="date_get_monday_week_of_year">g_date_get_monday_week_of_year</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
g_date_get_monday_week_of_year (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns the week of the year, where weeks are understood to start on
Monday. If the date is before the first Monday of the year, return 0.
The date must be valid.</para>
<refsect3 id="g-date-get-monday-week-of-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-monday-week-of-year.returns" role="returns">
<title>Returns</title>
<para> week of the year</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-monday-weeks-in-year" role="function">
<title>g_date_get_monday_weeks_in_year&#160;()</title>
<indexterm zone="g-date-get-monday-weeks-in-year"><primary sortas="date_get_monday_weeks_in_year">g_date_get_monday_weeks_in_year</primary></indexterm>
<programlisting language="C"><link linkend="guint8"><returnvalue>guint8</returnvalue></link>
g_date_get_monday_weeks_in_year (<parameter><link linkend="GDateYear"><type>GDateYear</type></link> year</parameter>);</programlisting>
<para>Returns the number of weeks in the year, where weeks
are taken to start on Monday. Will be 52 or 53. The
date must be valid. (Years always have 52 7-day periods,
plus 1 or 2 extra days depending on whether it's a leap
year. This function is basically telling you how many
Mondays are in the year, i.e. there are 53 Mondays if
one of the extra days happens to be a Monday.)</para>
<refsect3 id="g-date-get-monday-weeks-in-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>year</para></entry>
<entry role="parameter_description"><para>a year</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-monday-weeks-in-year.returns" role="returns">
<title>Returns</title>
<para> number of Mondays in the year</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-sunday-week-of-year" role="function">
<title>g_date_get_sunday_week_of_year&#160;()</title>
<indexterm zone="g-date-get-sunday-week-of-year"><primary sortas="date_get_sunday_week_of_year">g_date_get_sunday_week_of_year</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
g_date_get_sunday_week_of_year (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns the week of the year during which this date falls, if
weeks are understood to begin on Sunday. The date must be valid.
Can return 0 if the day is before the first Sunday of the year.</para>
<refsect3 id="g-date-get-sunday-week-of-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-sunday-week-of-year.returns" role="returns">
<title>Returns</title>
<para> week number</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-sunday-weeks-in-year" role="function">
<title>g_date_get_sunday_weeks_in_year&#160;()</title>
<indexterm zone="g-date-get-sunday-weeks-in-year"><primary sortas="date_get_sunday_weeks_in_year">g_date_get_sunday_weeks_in_year</primary></indexterm>
<programlisting language="C"><link linkend="guint8"><returnvalue>guint8</returnvalue></link>
g_date_get_sunday_weeks_in_year (<parameter><link linkend="GDateYear"><type>GDateYear</type></link> year</parameter>);</programlisting>
<para>Returns the number of weeks in the year, where weeks
are taken to start on Sunday. Will be 52 or 53. The
date must be valid. (Years always have 52 7-day periods,
plus 1 or 2 extra days depending on whether it's a leap
year. This function is basically telling you how many
Sundays are in the year, i.e. there are 53 Sundays if
one of the extra days happens to be a Sunday.)</para>
<refsect3 id="g-date-get-sunday-weeks-in-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>year</para></entry>
<entry role="parameter_description"><para>year to count weeks in</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-sunday-weeks-in-year.returns" role="returns">
<title>Returns</title>
<para> the number of weeks in <parameter>year</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="g-date-get-iso8601-week-of-year" role="function" condition="since:2.6">
<title>g_date_get_iso8601_week_of_year&#160;()</title>
<indexterm zone="g-date-get-iso8601-week-of-year" role="2.6"><primary sortas="date_get_iso8601_week_of_year">g_date_get_iso8601_week_of_year</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
g_date_get_iso8601_week_of_year (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns the week of the year, where weeks are interpreted according
to ISO 8601.</para>
<refsect3 id="g-date-get-iso8601-week-of-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a valid <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-get-iso8601-week-of-year.returns" role="returns">
<title>Returns</title>
<para> ISO 8601 week number of the year.</para>
</refsect3><para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="g-date-strftime" role="function">
<title>g_date_strftime&#160;()</title>
<indexterm zone="g-date-strftime"><primary sortas="date_strftime">g_date_strftime</primary></indexterm>
<programlisting language="C"><link linkend="gsize"><returnvalue>gsize</returnvalue></link>
g_date_strftime (<parameter><link linkend="gchar"><type>gchar</type></link> *s</parameter>,
                 <parameter><link linkend="gsize"><type>gsize</type></link> slen</parameter>,
                 <parameter>const <link linkend="gchar"><type>gchar</type></link> *format</parameter>,
                 <parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Generates a printed representation of the date, in a
<link linkend="setlocale">locale</link>-specific way.
Works just like the platform's C library <link linkend="strftime"><function>strftime()</function></link> function,
but only accepts date-related formats; time-related formats
give undefined results. Date must be valid. Unlike <link linkend="strftime"><function>strftime()</function></link>
(which uses the locale encoding), works on a UTF-8 format
string and stores a UTF-8 result.</para>
<para>This function does not provide any conversion specifiers in
addition to those implemented by the platform's C library.
For example, don't expect that using <link linkend="g-date-strftime"><function>g_date_strftime()</function></link> would
make the %F provided by the C99 <link linkend="strftime"><function>strftime()</function></link> work on Windows
where the C library only complies to C89.</para>
<refsect3 id="g-date-strftime.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>s</para></entry>
<entry role="parameter_description"><para>destination buffer</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>slen</para></entry>
<entry role="parameter_description"><para>buffer size</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>format</para></entry>
<entry role="parameter_description"><para>format string</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>valid <link linkend="GDate"><type>GDate</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-strftime.returns" role="returns">
<title>Returns</title>
<para> number of characters written to the buffer, or 0 the buffer was too small</para>
</refsect3></refsect2>
<refsect2 id="g-date-to-struct-tm" role="function">
<title>g_date_to_struct_tm&#160;()</title>
<indexterm zone="g-date-to-struct-tm"><primary sortas="date_to_struct_tm">g_date_to_struct_tm</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
g_date_to_struct_tm (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>,
                     <parameter><type>struct tm</type> *tm</parameter>);</programlisting>
<para>Fills in the date-related bits of a struct tm using the <parameter>date</parameter>
 value.
Initializes the non-date parts with something sane but meaningless.</para>
<refsect3 id="g-date-to-struct-tm.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to set the struct tm from</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>tm</para></entry>
<entry role="parameter_description"><para>struct tm to fill. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>not nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="g-date-valid" role="function">
<title>g_date_valid&#160;()</title>
<indexterm zone="g-date-valid"><primary sortas="date_valid">g_date_valid</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_valid (<parameter>const <link linkend="GDate"><type>GDate</type></link> *date</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the <link linkend="GDate"><type>GDate</type></link> represents an existing day. The date must not
contain garbage; it should have been initialized with <link linkend="g-date-clear"><function>g_date_clear()</function></link>
if it wasn't allocated by one of the <link linkend="g-date-new"><function>g_date_new()</function></link> variants.</para>
<refsect3 id="g-date-valid.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>date</para></entry>
<entry role="parameter_description"><para>a <link linkend="GDate"><type>GDate</type></link> to check</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-valid.returns" role="returns">
<title>Returns</title>
<para> Whether the date is valid</para>
</refsect3></refsect2>
<refsect2 id="g-date-valid-day" role="function">
<title>g_date_valid_day&#160;()</title>
<indexterm zone="g-date-valid-day"><primary sortas="date_valid_day">g_date_valid_day</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_valid_day (<parameter><link linkend="GDateDay"><type>GDateDay</type></link> day</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the day of the month is valid (a day is valid if it's
between 1 and 31 inclusive).</para>
<refsect3 id="g-date-valid-day.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>day</para></entry>
<entry role="parameter_description"><para>day to check</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-valid-day.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the day is valid</para>
</refsect3></refsect2>
<refsect2 id="g-date-valid-month" role="function">
<title>g_date_valid_month&#160;()</title>
<indexterm zone="g-date-valid-month"><primary sortas="date_valid_month">g_date_valid_month</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_valid_month (<parameter><link linkend="GDateMonth"><type>GDateMonth</type></link> month</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the month value is valid. The 12 <link linkend="GDateMonth"><type>GDateMonth</type></link>
enumeration values are the only valid months.</para>
<refsect3 id="g-date-valid-month.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>month</para></entry>
<entry role="parameter_description"><para>month</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-valid-month.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the month is valid</para>
</refsect3></refsect2>
<refsect2 id="g-date-valid-year" role="function">
<title>g_date_valid_year&#160;()</title>
<indexterm zone="g-date-valid-year"><primary sortas="date_valid_year">g_date_valid_year</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_valid_year (<parameter><link linkend="GDateYear"><type>GDateYear</type></link> year</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the year is valid. Any year greater than 0 is valid,
though there is a 16-bit limit to what <link linkend="GDate"><type>GDate</type></link> will understand.</para>
<refsect3 id="g-date-valid-year.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>year</para></entry>
<entry role="parameter_description"><para>year</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-valid-year.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the year is valid</para>
</refsect3></refsect2>
<refsect2 id="g-date-valid-dmy" role="function">
<title>g_date_valid_dmy&#160;()</title>
<indexterm zone="g-date-valid-dmy"><primary sortas="date_valid_dmy">g_date_valid_dmy</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_valid_dmy (<parameter><link linkend="GDateDay"><type>GDateDay</type></link> day</parameter>,
                  <parameter><link linkend="GDateMonth"><type>GDateMonth</type></link> month</parameter>,
                  <parameter><link linkend="GDateYear"><type>GDateYear</type></link> year</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the day-month-year triplet forms a valid, existing day
in the range of days <link linkend="GDate"><type>GDate</type></link> understands (Year 1 or later, no more than
a few thousand years in the future).</para>
<refsect3 id="g-date-valid-dmy.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>day</para></entry>
<entry role="parameter_description"><para>day</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>month</para></entry>
<entry role="parameter_description"><para>month</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>year</para></entry>
<entry role="parameter_description"><para>year</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-valid-dmy.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the date is a valid one</para>
</refsect3></refsect2>
<refsect2 id="g-date-valid-julian" role="function">
<title>g_date_valid_julian&#160;()</title>
<indexterm zone="g-date-valid-julian"><primary sortas="date_valid_julian">g_date_valid_julian</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_valid_julian (<parameter><link linkend="guint32"><type>guint32</type></link> julian_date</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the Julian day is valid. Anything greater than zero
is basically a valid Julian, though there is a 32-bit limit.</para>
<refsect3 id="g-date-valid-julian.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>julian_date</para></entry>
<entry role="parameter_description"><para>Julian day to check</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-valid-julian.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the Julian day is valid</para>
</refsect3></refsect2>
<refsect2 id="g-date-valid-weekday" role="function">
<title>g_date_valid_weekday&#160;()</title>
<indexterm zone="g-date-valid-weekday"><primary sortas="date_valid_weekday">g_date_valid_weekday</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
g_date_valid_weekday (<parameter><link linkend="GDateWeekday"><type>GDateWeekday</type></link> weekday</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the weekday is valid. The seven <link linkend="GDateWeekday"><type>GDateWeekday</type></link> enumeration
values are the only valid weekdays.</para>
<refsect3 id="g-date-valid-weekday.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>weekday</para></entry>
<entry role="parameter_description"><para>weekday</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-date-valid-weekday.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the weekday is valid</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="glib-Date-and-Time-Functions.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="G-USEC-PER-SEC:CAPS" role="macro">
<title>G_USEC_PER_SEC</title>
<indexterm zone="G-USEC-PER-SEC:CAPS"><primary sortas="USEC_PER_SEC">G_USEC_PER_SEC</primary></indexterm>
<programlisting language="C">#define G_USEC_PER_SEC 1000000
</programlisting>
<para>Number of microseconds in one second (1 million).
This macro is provided for code readability.</para>
</refsect2>
<refsect2 id="GDate" role="struct">
<title>struct GDate</title>
<indexterm zone="GDate"><primary sortas="Date">GDate</primary></indexterm>
<programlisting language="C">struct GDate {
  guint julian_days : 32; /* julian days representation - we use a
                           *  bitfield hoping that 64 bit platforms
                           *  will pack this whole struct in one big
                           *  int
                           */

  guint julian : 1;    /* julian is valid */
  guint dmy    : 1;    /* dmy is valid */

  /* DMY representation */
  guint day    : 6;
  guint month  : 4;
  guint year   : 16;
};
</programlisting>
<para>Represents a day between January 1, Year 1 and a few thousand years in
the future. None of its members should be accessed directly.</para>
<para>If the <link linkend="GDate-struct"><type>GDate</type></link> is obtained from <link linkend="g-date-new"><function>g_date_new()</function></link>, it will be safe
to mutate but invalid and thus not safe for calendrical computations.</para>
<para>If it's declared on the stack, it will contain garbage so must be
initialized with <link linkend="g-date-clear"><function>g_date_clear()</function></link>. <link linkend="g-date-clear"><function>g_date_clear()</function></link> makes the date invalid
but sane. An invalid date doesn't represent a day, it's "empty." A date
becomes valid after you set it to a Julian day or you set a day, month,
and year.</para>
<refsect3 id="GDate.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GDate.julian-days">julian_days</structfield>&#160;:&#160;32;</para></entry>
<entry role="struct_member_description"><para>the Julian representation of the date</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GDate.julian">julian</structfield>&#160;:&#160;1;</para></entry>
<entry role="struct_member_description"><para>this bit is set if <parameter>julian_days</parameter>
is valid</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GDate.dmy">dmy</structfield>&#160;:&#160;1;</para></entry>
<entry role="struct_member_description"><para>this is set if <parameter>day</parameter>
, <parameter>month</parameter>
and <parameter>year</parameter>
are valid</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GDate.day">day</structfield>&#160;:&#160;6;</para></entry>
<entry role="struct_member_description"><para>the day of the day-month-year representation of the date,
as a number between 1 and 31</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GDate.month">month</structfield>&#160;:&#160;4;</para></entry>
<entry role="struct_member_description"><para>the day of the day-month-year representation of the date,
as a number between 1 and 12</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="guint"><type>guint</type></link>&#160;<structfield id="GDate.year">year</structfield>&#160;:&#160;16;</para></entry>
<entry role="struct_member_description"><para>the day of the day-month-year representation of the date</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>
<refsect2 id="GDateDMY" role="enum" condition="deprecated:">
<title>enum GDateDMY</title>
<indexterm zone="GDateDMY" role="deprecated"><primary sortas="DateDMY">GDateDMY</primary></indexterm>
<warning><para><literal>GDateDMY</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>This enumeration isn't used in the API, but may be useful if you need
to mark a number as a day, month, or year.</para>
<refsect3 id="GDateDMY.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-DAY:CAPS">G_DATE_DAY</para></entry>
<entry role="enum_member_description"><para>a day</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-MONTH:CAPS">G_DATE_MONTH</para></entry>
<entry role="enum_member_description"><para>a month</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-YEAR:CAPS">G_DATE_YEAR</para></entry>
<entry role="enum_member_description"><para>a year</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="GDateDay" role="typedef" condition="deprecated:">
<title>GDateDay</title>
<indexterm zone="GDateDay" role="deprecated"><primary sortas="DateDay">GDateDay</primary></indexterm>
<programlisting language="C">typedef guint8  GDateDay;   /* day of the month */
</programlisting>
<warning><para><literal>GDateDay</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>Integer representing a day of the month; between 1 and 31.
<link linkend="G-DATE-BAD-DAY:CAPS"><type>G_DATE_BAD_DAY</type></link> represents an invalid day of the month.</para>
</refsect2>
<refsect2 id="GDateMonth" role="enum">
<title>enum GDateMonth</title>
<indexterm zone="GDateMonth"><primary sortas="DateMonth">GDateMonth</primary></indexterm>
<para>Enumeration representing a month; values are <link linkend="G-DATE-JANUARY:CAPS"><type>G_DATE_JANUARY</type></link>,
<link linkend="G-DATE-FEBRUARY:CAPS"><type>G_DATE_FEBRUARY</type></link>, etc. <link linkend="G-DATE-BAD-MONTH:CAPS"><type>G_DATE_BAD_MONTH</type></link> is the invalid value.</para>
<refsect3 id="GDateMonth.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-BAD-MONTH:CAPS">G_DATE_BAD_MONTH</para></entry>
<entry role="enum_member_description"><para>invalid value</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-JANUARY:CAPS">G_DATE_JANUARY</para></entry>
<entry role="enum_member_description"><para>January</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-FEBRUARY:CAPS">G_DATE_FEBRUARY</para></entry>
<entry role="enum_member_description"><para>February</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-MARCH:CAPS">G_DATE_MARCH</para></entry>
<entry role="enum_member_description"><para>March</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-APRIL:CAPS">G_DATE_APRIL</para></entry>
<entry role="enum_member_description"><para>April</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-MAY:CAPS">G_DATE_MAY</para></entry>
<entry role="enum_member_description"><para>May</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-JUNE:CAPS">G_DATE_JUNE</para></entry>
<entry role="enum_member_description"><para>June</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-JULY:CAPS">G_DATE_JULY</para></entry>
<entry role="enum_member_description"><para>July</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-AUGUST:CAPS">G_DATE_AUGUST</para></entry>
<entry role="enum_member_description"><para>August</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-SEPTEMBER:CAPS">G_DATE_SEPTEMBER</para></entry>
<entry role="enum_member_description"><para>September</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-OCTOBER:CAPS">G_DATE_OCTOBER</para></entry>
<entry role="enum_member_description"><para>October</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-NOVEMBER:CAPS">G_DATE_NOVEMBER</para></entry>
<entry role="enum_member_description"><para>November</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-DECEMBER:CAPS">G_DATE_DECEMBER</para></entry>
<entry role="enum_member_description"><para>December</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="GDateYear" role="typedef" condition="deprecated:">
<title>GDateYear</title>
<indexterm zone="GDateYear" role="deprecated"><primary sortas="DateYear">GDateYear</primary></indexterm>
<programlisting language="C">typedef guint16 GDateYear;
</programlisting>
<warning><para><literal>GDateYear</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>Integer representing a year; <link linkend="G-DATE-BAD-YEAR:CAPS"><type>G_DATE_BAD_YEAR</type></link> is the invalid
value. The year must be 1 or higher; negative (BC) years are not
allowed. The year is represented with four digits.</para>
</refsect2>
<refsect2 id="GDateWeekday" role="enum">
<title>enum GDateWeekday</title>
<indexterm zone="GDateWeekday"><primary sortas="DateWeekday">GDateWeekday</primary></indexterm>
<para>Enumeration representing a day of the week; <link linkend="G-DATE-MONDAY:CAPS"><type>G_DATE_MONDAY</type></link>,
<link linkend="G-DATE-TUESDAY:CAPS"><type>G_DATE_TUESDAY</type></link>, etc. <link linkend="G-DATE-BAD-WEEKDAY:CAPS"><type>G_DATE_BAD_WEEKDAY</type></link> is an invalid weekday.</para>
<refsect3 id="GDateWeekday.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-BAD-WEEKDAY:CAPS">G_DATE_BAD_WEEKDAY</para></entry>
<entry role="enum_member_description"><para>invalid value</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-MONDAY:CAPS">G_DATE_MONDAY</para></entry>
<entry role="enum_member_description"><para>Monday</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-TUESDAY:CAPS">G_DATE_TUESDAY</para></entry>
<entry role="enum_member_description"><para>Tuesday</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-WEDNESDAY:CAPS">G_DATE_WEDNESDAY</para></entry>
<entry role="enum_member_description"><para>Wednesday</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-THURSDAY:CAPS">G_DATE_THURSDAY</para></entry>
<entry role="enum_member_description"><para>Thursday</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-FRIDAY:CAPS">G_DATE_FRIDAY</para></entry>
<entry role="enum_member_description"><para>Friday</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-SATURDAY:CAPS">G_DATE_SATURDAY</para></entry>
<entry role="enum_member_description"><para>Saturday</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="G-DATE-SUNDAY:CAPS">G_DATE_SUNDAY</para></entry>
<entry role="enum_member_description"><para>Sunday</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="G-DATE-BAD-DAY:CAPS" role="macro">
<title>G_DATE_BAD_DAY</title>
<indexterm zone="G-DATE-BAD-DAY:CAPS"><primary sortas="DATE_BAD_DAY">G_DATE_BAD_DAY</primary></indexterm>
<programlisting language="C">#define G_DATE_BAD_DAY    0U
</programlisting>
<para>Represents an invalid <link linkend="GDateDay"><type>GDateDay</type></link>.</para>
</refsect2>
<refsect2 id="G-DATE-BAD-JULIAN:CAPS" role="macro">
<title>G_DATE_BAD_JULIAN</title>
<indexterm zone="G-DATE-BAD-JULIAN:CAPS"><primary sortas="DATE_BAD_JULIAN">G_DATE_BAD_JULIAN</primary></indexterm>
<programlisting language="C">#define G_DATE_BAD_JULIAN 0U
</programlisting>
<para>Represents an invalid Julian day number.</para>
</refsect2>
<refsect2 id="G-DATE-BAD-YEAR:CAPS" role="macro">
<title>G_DATE_BAD_YEAR</title>
<indexterm zone="G-DATE-BAD-YEAR:CAPS"><primary sortas="DATE_BAD_YEAR">G_DATE_BAD_YEAR</primary></indexterm>
<programlisting language="C">#define G_DATE_BAD_YEAR   0U
</programlisting>
<para>Represents an invalid year.</para>
</refsect2>

</refsect1>

</refentry>
