36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="glib-Random-Numbers.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
39
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3090178" class="shortcut">Top</a>
41
<a href="#id3091764" class="shortcut">Description</a></nobr></td></tr>
40
<tr><td colspan="5" class="shortcuts">
41
<a href="#glib-Date-and-Time-Functions.synopsis" class="shortcut">Top</a>
43
<a href="#glib-Date-and-Time-Functions.description" class="shortcut">Description</a>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-Date-and-Time-Functions"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
48
<a name="id3090178"></a><span class="refentrytitle">Date and Time Functions</span>
50
<p>Date and Time Functions — calendrical calculations and miscellaneous time stuff</p>
50
<h2><span class="refentrytitle"><a name="glib-Date-and-Time-Functions.top_of_page"></a>Date and Time Functions</span></h2>
51
<p>Date and Time Functions — calendrical calculations and miscellaneous time stuff</p>
52
53
<td valign="top" align="right"></td>
53
54
</tr></table></div>
54
55
<div class="refsynopsisdiv">
56
<a name="glib-Date-and-Time-Functions.synopsis"></a><h2>Synopsis</h2>
56
57
<pre class="synopsis">
58
59
#include <glib.h>
61
#define <a class="link" href="glib-Date-and-Time-Functions.html#G-USEC-PER-SEC:CAPS">G_USEC_PER_SEC</a>
62
<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a>;
63
void <a class="link" href="glib-Date-and-Time-Functions.html#g-get-current-time">g_get_current_time</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a> *result);
64
void <a class="link" href="glib-Date-and-Time-Functions.html#g-usleep">g_usleep</a> (<a class="link" href="glib-Basic-Types.html#gulong">gulong</a> microseconds);
65
void <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-add">g_time_val_add</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a> *time_,
66
<a class="link" href="glib-Basic-Types.html#glong">glong</a> microseconds);
67
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-from-iso8601">g_time_val_from_iso8601</a> (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *iso_date,
68
<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a> *time_);
69
<a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-to-iso8601">g_time_val_to_iso8601</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a> *time_);
71
<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a>;
72
typedef <a class="link" href="glib-Date-and-Time-Functions.html#GTime">GTime</a>;
73
enum <a class="link" href="glib-Date-and-Time-Functions.html#GDateDMY">GDateDMY</a>;
74
typedef <a class="link" href="glib-Date-and-Time-Functions.html#GDateDay">GDateDay</a>;
75
enum <a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth">GDateMonth</a>;
76
typedef <a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a>;
77
enum <a class="link" href="glib-Date-and-Time-Functions.html#GDateWeekday">GDateWeekday</a>;
79
#define <a class="link" href="glib-Date-and-Time-Functions.html#G-DATE-BAD-DAY:CAPS">G_DATE_BAD_DAY</a>
80
#define <a class="link" href="glib-Date-and-Time-Functions.html#G-DATE-BAD-JULIAN:CAPS">G_DATE_BAD_JULIAN</a>
81
#define <a class="link" href="glib-Date-and-Time-Functions.html#G-DATE-BAD-YEAR:CAPS">G_DATE_BAD_YEAR</a>
83
<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a>* <a class="link" href="glib-Date-and-Time-Functions.html#g-date-new">g_date_new</a> (void);
84
<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a>* <a class="link" href="glib-Date-and-Time-Functions.html#g-date-new-dmy">g_date_new_dmy</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay">GDateDay</a> day,
85
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth">GDateMonth</a> month,
86
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> year);
87
<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a>* <a class="link" href="glib-Date-and-Time-Functions.html#g-date-new-julian">g_date_new_julian</a> (<a class="link" href="glib-Basic-Types.html#guint32">guint32</a> julian_day);
88
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-clear">g_date_clear</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
89
<a class="link" href="glib-Basic-Types.html#guint">guint</a> n_dates);
90
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-free">g_date_free</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
92
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-day">g_date_set_day</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
93
<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay">GDateDay</a> day);
94
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-month">g_date_set_month</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
95
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth">GDateMonth</a> month);
96
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-year">g_date_set_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
97
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> year);
98
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-dmy">g_date_set_dmy</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
99
<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay">GDateDay</a> day,
100
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth">GDateMonth</a> month,
101
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> y);
102
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-julian">g_date_set_julian</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
103
<a class="link" href="glib-Basic-Types.html#guint32">guint32</a> julian_date);
104
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-time">g_date_set_time</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
105
<a class="link" href="glib-Date-and-Time-Functions.html#GTime">GTime</a> time_);
106
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-time-t">g_date_set_time_t</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
61
#define <a class="link" href="glib-Date-and-Time-Functions.html#G-USEC-PER-SEC--CAPS" title="G_USEC_PER_SEC">G_USEC_PER_SEC</a>
62
<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a>;
63
void <a class="link" href="glib-Date-and-Time-Functions.html#g-get-current-time" title="g_get_current_time ()">g_get_current_time</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a> *result);
64
void <a class="link" href="glib-Date-and-Time-Functions.html#g-usleep" title="g_usleep ()">g_usleep</a> (<a class="link" href="glib-Basic-Types.html#gulong" title="gulong">gulong</a> microseconds);
65
void <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-add" title="g_time_val_add ()">g_time_val_add</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a> *time_,
66
<a class="link" href="glib-Basic-Types.html#glong" title="glong">glong</a> microseconds);
67
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-from-iso8601" title="g_time_val_from_iso8601 ()">g_time_val_from_iso8601</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *iso_date,
68
<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a> *time_);
69
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a>* <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-to-iso8601" title="g_time_val_to_iso8601 ()">g_time_val_to_iso8601</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a> *time_);
71
<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a>;
72
typedef <a class="link" href="glib-Date-and-Time-Functions.html#GTime" title="GTime">GTime</a>;
73
enum <a class="link" href="glib-Date-and-Time-Functions.html#GDateDMY" title="enum GDateDMY">GDateDMY</a>;
74
typedef <a class="link" href="glib-Date-and-Time-Functions.html#GDateDay" title="GDateDay">GDateDay</a>;
75
enum <a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth" title="enum GDateMonth">GDateMonth</a>;
76
typedef <a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a>;
77
enum <a class="link" href="glib-Date-and-Time-Functions.html#GDateWeekday" title="enum GDateWeekday">GDateWeekday</a>;
79
#define <a class="link" href="glib-Date-and-Time-Functions.html#G-DATE-BAD-DAY--CAPS" title="G_DATE_BAD_DAY">G_DATE_BAD_DAY</a>
80
#define <a class="link" href="glib-Date-and-Time-Functions.html#G-DATE-BAD-JULIAN--CAPS" title="G_DATE_BAD_JULIAN">G_DATE_BAD_JULIAN</a>
81
#define <a class="link" href="glib-Date-and-Time-Functions.html#G-DATE-BAD-YEAR--CAPS" title="G_DATE_BAD_YEAR">G_DATE_BAD_YEAR</a>
83
<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a>* <a class="link" href="glib-Date-and-Time-Functions.html#g-date-new" title="g_date_new ()">g_date_new</a> (void);
84
<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a>* <a class="link" href="glib-Date-and-Time-Functions.html#g-date-new-dmy" title="g_date_new_dmy ()">g_date_new_dmy</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay" title="GDateDay">GDateDay</a> day,
85
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth" title="enum GDateMonth">GDateMonth</a> month,
86
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> year);
87
<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a>* <a class="link" href="glib-Date-and-Time-Functions.html#g-date-new-julian" title="g_date_new_julian ()">g_date_new_julian</a> (<a class="link" href="glib-Basic-Types.html#guint32" title="guint32">guint32</a> julian_day);
88
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-clear" title="g_date_clear ()">g_date_clear</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
89
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n_dates);
90
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-free" title="g_date_free ()">g_date_free</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
92
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-day" title="g_date_set_day ()">g_date_set_day</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
93
<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay" title="GDateDay">GDateDay</a> day);
94
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-month" title="g_date_set_month ()">g_date_set_month</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
95
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth" title="enum GDateMonth">GDateMonth</a> month);
96
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-year" title="g_date_set_year ()">g_date_set_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
97
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> year);
98
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-dmy" title="g_date_set_dmy ()">g_date_set_dmy</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
99
<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay" title="GDateDay">GDateDay</a> day,
100
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth" title="enum GDateMonth">GDateMonth</a> month,
101
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> y);
102
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-julian" title="g_date_set_julian ()">g_date_set_julian</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
103
<a class="link" href="glib-Basic-Types.html#guint32" title="guint32">guint32</a> julian_date);
104
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-time" title="g_date_set_time ()">g_date_set_time</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
105
<a class="link" href="glib-Date-and-Time-Functions.html#GTime" title="GTime">GTime</a> time_);
106
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-time-t" title="g_date_set_time_t ()">g_date_set_time_t</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
108
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-time-val">g_date_set_time_val</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
109
<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a> *timeval);
110
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-parse">g_date_set_parse</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
111
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str);
113
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-add-days">g_date_add_days</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
114
<a class="link" href="glib-Basic-Types.html#guint">guint</a> n_days);
115
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-subtract-days">g_date_subtract_days</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
116
<a class="link" href="glib-Basic-Types.html#guint">guint</a> n_days);
117
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-add-months">g_date_add_months</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
118
<a class="link" href="glib-Basic-Types.html#guint">guint</a> n_months);
119
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-subtract-months">g_date_subtract_months</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
120
<a class="link" href="glib-Basic-Types.html#guint">guint</a> n_months);
121
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-add-years">g_date_add_years</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
122
<a class="link" href="glib-Basic-Types.html#guint">guint</a> n_years);
123
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-subtract-years">g_date_subtract_years</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
124
<a class="link" href="glib-Basic-Types.html#guint">guint</a> n_years);
125
<a class="link" href="glib-Basic-Types.html#gint">gint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-days-between">g_date_days_between</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date1,
126
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date2);
127
<a class="link" href="glib-Basic-Types.html#gint">gint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-compare">g_date_compare</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *lhs,
128
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *rhs);
129
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-clamp">g_date_clamp</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
130
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *min_date,
131
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *max_date);
132
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-order">g_date_order</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date1,
133
<a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date2);
135
<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay">GDateDay</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-day">g_date_get_day</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
136
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth">GDateMonth</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-month">g_date_get_month</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
137
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-year">g_date_get_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
138
<a class="link" href="glib-Basic-Types.html#guint32">guint32</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-julian">g_date_get_julian</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
139
<a class="link" href="glib-Date-and-Time-Functions.html#GDateWeekday">GDateWeekday</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-weekday">g_date_get_weekday</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
140
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-day-of-year">g_date_get_day_of_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
142
<a class="link" href="glib-Basic-Types.html#guint8">guint8</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-days-in-month">g_date_get_days_in_month</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth">GDateMonth</a> month,
143
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> year);
144
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-is-first-of-month">g_date_is_first_of_month</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
145
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-is-last-of-month">g_date_is_last_of_month</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
146
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-is-leap-year">g_date_is_leap_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> year);
147
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-monday-week-of-year">g_date_get_monday_week_of_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
148
<a class="link" href="glib-Basic-Types.html#guint8">guint8</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-monday-weeks-in-year">g_date_get_monday_weeks_in_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> year);
149
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-sunday-week-of-year">g_date_get_sunday_week_of_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
150
<a class="link" href="glib-Basic-Types.html#guint8">guint8</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-sunday-weeks-in-year">g_date_get_sunday_weeks_in_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> year);
151
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-iso8601-week-of-year">g_date_get_iso8601_week_of_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
153
<a class="link" href="glib-Basic-Types.html#gsize">gsize</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-strftime">g_date_strftime</a> (<a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *s,
154
<a class="link" href="glib-Basic-Types.html#gsize">gsize</a> slen,
155
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *format,
156
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
157
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-to-struct-tm">g_date_to_struct_tm</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date,
108
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-time-val" title="g_date_set_time_val ()">g_date_set_time_val</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
109
<a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a> *timeval);
110
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-parse" title="g_date_set_parse ()">g_date_set_parse</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
111
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *str);
113
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-add-days" title="g_date_add_days ()">g_date_add_days</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
114
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n_days);
115
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-subtract-days" title="g_date_subtract_days ()">g_date_subtract_days</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
116
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n_days);
117
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-add-months" title="g_date_add_months ()">g_date_add_months</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
118
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n_months);
119
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-subtract-months" title="g_date_subtract_months ()">g_date_subtract_months</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
120
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n_months);
121
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-add-years" title="g_date_add_years ()">g_date_add_years</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
122
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n_years);
123
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-subtract-years" title="g_date_subtract_years ()">g_date_subtract_years</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
124
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n_years);
125
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-days-between" title="g_date_days_between ()">g_date_days_between</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date1,
126
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date2);
127
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-compare" title="g_date_compare ()">g_date_compare</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *lhs,
128
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *rhs);
129
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-clamp" title="g_date_clamp ()">g_date_clamp</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
130
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *min_date,
131
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *max_date);
132
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-order" title="g_date_order ()">g_date_order</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date1,
133
<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date2);
135
<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay" title="GDateDay">GDateDay</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-day" title="g_date_get_day ()">g_date_get_day</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
136
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth" title="enum GDateMonth">GDateMonth</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-month" title="g_date_get_month ()">g_date_get_month</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
137
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-year" title="g_date_get_year ()">g_date_get_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
138
<a class="link" href="glib-Basic-Types.html#guint32" title="guint32">guint32</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-julian" title="g_date_get_julian ()">g_date_get_julian</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
139
<a class="link" href="glib-Date-and-Time-Functions.html#GDateWeekday" title="enum GDateWeekday">GDateWeekday</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-weekday" title="g_date_get_weekday ()">g_date_get_weekday</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
140
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-day-of-year" title="g_date_get_day_of_year ()">g_date_get_day_of_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
142
<a class="link" href="glib-Basic-Types.html#guint8" title="guint8">guint8</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-days-in-month" title="g_date_get_days_in_month ()">g_date_get_days_in_month</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth" title="enum GDateMonth">GDateMonth</a> month,
143
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> year);
144
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-is-first-of-month" title="g_date_is_first_of_month ()">g_date_is_first_of_month</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
145
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-is-last-of-month" title="g_date_is_last_of_month ()">g_date_is_last_of_month</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
146
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-is-leap-year" title="g_date_is_leap_year ()">g_date_is_leap_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> year);
147
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-monday-week-of-year" title="g_date_get_monday_week_of_year ()">g_date_get_monday_week_of_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
148
<a class="link" href="glib-Basic-Types.html#guint8" title="guint8">guint8</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-monday-weeks-in-year" title="g_date_get_monday_weeks_in_year ()">g_date_get_monday_weeks_in_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> year);
149
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-sunday-week-of-year" title="g_date_get_sunday_week_of_year ()">g_date_get_sunday_week_of_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
150
<a class="link" href="glib-Basic-Types.html#guint8" title="guint8">guint8</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-sunday-weeks-in-year" title="g_date_get_sunday_weeks_in_year ()">g_date_get_sunday_weeks_in_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> year);
151
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-get-iso8601-week-of-year" title="g_date_get_iso8601_week_of_year ()">g_date_get_iso8601_week_of_year</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
153
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-strftime" title="g_date_strftime ()">g_date_strftime</a> (<a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *s,
154
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> slen,
155
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *format,
156
const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
157
void <a class="link" href="glib-Date-and-Time-Functions.html#g-date-to-struct-tm" title="g_date_to_struct_tm ()">g_date_to_struct_tm</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date,
160
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid">g_date_valid</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate">GDate</a> *date);
161
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-day">g_date_valid_day</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay">GDateDay</a> day);
162
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-month">g_date_valid_month</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth">GDateMonth</a> month);
163
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-year">g_date_valid_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> year);
164
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-dmy">g_date_valid_dmy</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay">GDateDay</a> day,
165
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth">GDateMonth</a> month,
166
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear">GDateYear</a> year);
167
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-julian">g_date_valid_julian</a> (<a class="link" href="glib-Basic-Types.html#guint32">guint32</a> julian_date);
168
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-weekday">g_date_valid_weekday</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateWeekday">GDateWeekday</a> weekday);
160
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid" title="g_date_valid ()">g_date_valid</a> (const <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate">GDate</a> *date);
161
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-day" title="g_date_valid_day ()">g_date_valid_day</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay" title="GDateDay">GDateDay</a> day);
162
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-month" title="g_date_valid_month ()">g_date_valid_month</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth" title="enum GDateMonth">GDateMonth</a> month);
163
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-year" title="g_date_valid_year ()">g_date_valid_year</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> year);
164
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-dmy" title="g_date_valid_dmy ()">g_date_valid_dmy</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateDay" title="GDateDay">GDateDay</a> day,
165
<a class="link" href="glib-Date-and-Time-Functions.html#GDateMonth" title="enum GDateMonth">GDateMonth</a> month,
166
<a class="link" href="glib-Date-and-Time-Functions.html#GDateYear" title="GDateYear">GDateYear</a> year);
167
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-julian" title="g_date_valid_julian ()">g_date_valid_julian</a> (<a class="link" href="glib-Basic-Types.html#guint32" title="guint32">guint32</a> julian_date);
168
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid-weekday" title="g_date_valid_weekday ()">g_date_valid_weekday</a> (<a class="link" href="glib-Date-and-Time-Functions.html#GDateWeekday" title="enum GDateWeekday">GDateWeekday</a> weekday);
172
171
<div class="refsect1" lang="en">
173
<a name="id3091764"></a><h2>Description</h2>
172
<a name="glib-Date-and-Time-Functions.description"></a><h2>Description</h2>
175
The <a class="link" href="glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> data structure represents a day between January 1, Year 1,
174
The <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate"><span class="type">GDate</span></a> data structure represents a day between January 1, Year 1,
176
175
and sometime a few thousand years in the future (right now it will go
177
to the year 65535 or so, but <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-parse"><code class="function">g_date_set_parse()</code></a> only parses up to the
178
year 8000 or so - just count on "a few thousand"). <a class="link" href="glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> is meant to
176
to the year 65535 or so, but <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-parse" title="g_date_set_parse ()"><code class="function">g_date_set_parse()</code></a> only parses up to the
177
year 8000 or so - just count on "a few thousand"). <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate"><span class="type">GDate</span></a> is meant to
179
178
represent everyday dates, not astronomical dates or historical dates
180
179
or ISO timestamps or the like. It extrapolates the current Gregorian
181
180
calendar forward and backward in time; there is no attempt to change
182
the calendar to match time periods or locations. <a class="link" href="glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> does not store
181
the calendar to match time periods or locations. <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate"><span class="type">GDate</span></a> does not store
183
182
time information; it represents a <span class="emphasis"><em>day</em></span>.
186
The <a class="link" href="glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> implementation has several nice features; it is only a
185
The <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate"><span class="type">GDate</span></a> implementation has several nice features; it is only a
187
186
64-bit struct, so storing large numbers of dates is very efficient. It
188
187
can keep both a Julian and day-month-year representation of the date,
189
188
since some calculations are much easier with one representation or the
190
189
other. A Julian representation is simply a count of days since some
191
fixed day in the past; for <a class="link" href="glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> the fixed day is January 1, 1 AD.
192
("Julian" dates in the <a class="link" href="glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> API aren't really Julian dates in the
190
fixed day in the past; for <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate"><span class="type">GDate</span></a> the fixed day is January 1, 1 AD.
191
("Julian" dates in the <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate"><span class="type">GDate</span></a> API aren't really Julian dates in the
193
192
technical sense; technically, Julian dates count from the start of the
194
193
Julian period, Jan 1, 4713 BC).
197
<a class="link" href="glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a> is simple to use. First you need a "blank" date; you can get a
198
dynamically allocated date from <a class="link" href="glib-Date-and-Time-Functions.html#g-date-new"><code class="function">g_date_new()</code></a>, or you can declare an
196
<a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate"><span class="type">GDate</span></a> is simple to use. First you need a "blank" date; you can get a
197
dynamically allocated date from <a class="link" href="glib-Date-and-Time-Functions.html#g-date-new" title="g_date_new ()"><code class="function">g_date_new()</code></a>, or you can declare an
199
198
automatic variable or array and initialize it to a sane state by
200
calling <a class="link" href="glib-Date-and-Time-Functions.html#g-date-clear"><code class="function">g_date_clear()</code></a>. A cleared date is sane; it's safe to call
201
<a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-dmy"><code class="function">g_date_set_dmy()</code></a> and the other mutator functions to initialize the
199
calling <a class="link" href="glib-Date-and-Time-Functions.html#g-date-clear" title="g_date_clear ()"><code class="function">g_date_clear()</code></a>. A cleared date is sane; it's safe to call
200
<a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-dmy" title="g_date_set_dmy ()"><code class="function">g_date_set_dmy()</code></a> and the other mutator functions to initialize the
202
201
value of a cleared date. However, a cleared date is initially
203
202
<span class="emphasis"><em>invalid</em></span>, meaning that it doesn't represent a day
204
203
that exists. It is undefined to call any of the date calculation
205
204
routines on an invalid date. If you obtain a date from a user or other
206
205
unpredictable source, you should check its validity with the
207
<a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid"><code class="function">g_date_valid()</code></a> predicate. <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid"><code class="function">g_date_valid()</code></a> is also used to check for
208
errors with <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-parse"><code class="function">g_date_set_parse()</code></a> and other functions that can
209
fail. Dates can be invalidated by calling <a class="link" href="glib-Date-and-Time-Functions.html#g-date-clear"><code class="function">g_date_clear()</code></a> again.
206
<a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid" title="g_date_valid ()"><code class="function">g_date_valid()</code></a> predicate. <a class="link" href="glib-Date-and-Time-Functions.html#g-date-valid" title="g_date_valid ()"><code class="function">g_date_valid()</code></a> is also used to check for
207
errors with <a class="link" href="glib-Date-and-Time-Functions.html#g-date-set-parse" title="g_date_set_parse ()"><code class="function">g_date_set_parse()</code></a> and other functions that can
208
fail. Dates can be invalidated by calling <a class="link" href="glib-Date-and-Time-Functions.html#g-date-clear" title="g_date_clear ()"><code class="function">g_date_clear()</code></a> again.
212
<span class="emphasis"><em>It is very important to use the API to access the <a class="link" href="glib-Date-and-Time-Functions.html#GDate"><span class="type">GDate</span></a>
211
<span class="emphasis"><em>It is very important to use the API to access the <a class="link" href="glib-Date-and-Time-Functions.html#GDate" title="GDate"><span class="type">GDate</span></a>
213
212
struct.</em></span> Often only the day-month-year or only the Julian
214
213
representation is valid. Sometimes neither is valid. Use the API.
217
216
GLib doesn't contain any time-manipulation functions; however, there
218
is a <a class="link" href="glib-Date-and-Time-Functions.html#GTime"><span class="type">GTime</span></a> typedef and a <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal"><span class="type">GTimeVal</span></a> struct which represents a more
219
precise time (with microseconds). You can request the current time as
220
a <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal"><span class="type">GTimeVal</span></a> with <a class="link" href="glib-Date-and-Time-Functions.html#g-get-current-time"><code class="function">g_get_current_time()</code></a>.
217
is a <a class="link" href="glib-Date-and-Time-Functions.html#GTime" title="GTime"><span class="type">GTime</span></a> typedef and a <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal"><span class="type">GTimeVal</span></a> struct which represents a more
218
precise time (with microseconds). You can request the current time as
219
a <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal"><span class="type">GTimeVal</span></a> with <a class="link" href="glib-Date-and-Time-Functions.html#g-get-current-time" title="g_get_current_time ()"><code class="function">g_get_current_time()</code></a>.
223
222
<div class="refsect1" lang="en">
224
<a name="id3092021"></a><h2>Details</h2>
223
<a name="glib-Date-and-Time-Functions.details"></a><h2>Details</h2>
225
224
<div class="refsect2" lang="en">
226
<a name="id3092030"></a><h3>
227
<a name="G-USEC-PER-SEC:CAPS"></a>G_USEC_PER_SEC</h3>
228
<a class="indexterm" name="id3092043"></a><pre class="programlisting">#define G_USEC_PER_SEC 1000000
225
<a name="G-USEC-PER-SEC--CAPS"></a><h3>G_USEC_PER_SEC</h3>
226
<pre class="programlisting">#define G_USEC_PER_SEC 1000000
231
229
Number of microseconds in one second (1 million). This macro is provided for