the day of the day-month-year representation of the date, as a number between 1 and 31
this is set if @day, @month and @year are valid
this bit is set if @julian_days is valid
the Julian representation of the date
the month of the day-month-year representation of the date, as a number between 1 and 12
the year of the day-month-year representation of the date
glib.date.Date is a struct for calendrical calculations.
The glib.date.Date 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 glib.date.Date.setParse only parses up to the year 8000 or so - just count on "a few thousand"). glib.date.Date 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. glib.date.Date does not store time information; it represents a day.
The glib.date.Date 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 #GDate the fixed day is January 1, 1 AD. ("Julian" dates in the #GDate 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).
glib.date.Date is simple to use. First you need a "blank" date; you can get a dynamically allocated date from glib.date.Date.new_, or you can declare an automatic variable or array and initialize it by calling glib.date.Date.clear. A cleared date is safe; it's safe to call glib.date.Date.setDmy 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 glib.date.Date.valid predicate. glib.date.Date.valid is also used to check for errors with glib.date.Date.setParse and other functions that can fail. Dates can be invalidated by calling glib.date.Date.clear again.
It is very important to use the API to access the glib.date.Date struct. Often only the day-month-year or only the Julian representation is valid. Sometimes neither is valid. Use the API.
GLib also features glib.date_time.DateTime which represents a precise time.