datetime: Rework time zone support in constructors
authorEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 14 Sep 2010 07:00:40 +0000 (08:00 +0100)
committerRyan Lortie <desrt@desrt.ca>
Fri, 17 Sep 2010 15:40:10 +0000 (11:40 -0400)
commit67f1e52ce2a1372e4f8ffc5fdf292b33120264ab
treee9f11b6f977d8c245ebbb4a2310291d2a483a273
parentbff4ac15d09a3f80551fda41f8ff2e2c1ae30d91
datetime: Rework time zone support in constructors

Timezone handling is complicated. Really complicated.

In order to simplify it a little bit, we need to expose the GTimeZone
structure.

First of all, we allow creating time zone information directly from the
offset and the DST state, and then pass it to the g_date_time_new_full()
constructor. We also need to clean up the mess that is UTC-vs.-localtime
for the other constructors.

We also allow creating a GTimeZone from the Olson zoneinfo database
names; a time zone created like this will be "floating": it will just
reference the zoneinfo file - which are mmap()'ed, kept in a cache and
refcounted. Once the GTimeZone has been associated with a GDateTime, it
will be "anchored" to it: the offset will be resolved, as well as the
DST state.

https://bugzilla.gnome.org/show_bug.cgi?id=50076
docs/reference/glib/glib-sections.txt
glib/gdatetime.c
glib/gdatetime.h
glib/glib.symbols
glib/tests/gdatetime.c