mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
gdatetime: Add g_date_time_get_timezone() accessor
This is a trivial method to get the GTimeZone for the GDateTime. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=795165
This commit is contained in:
parent
4e6dc6f2a7
commit
9ddd17d304
@ -1743,6 +1743,7 @@ g_date_time_to_timeval
|
||||
|
||||
<SUBSECTION>
|
||||
g_date_time_get_utc_offset
|
||||
g_date_time_get_timezone
|
||||
g_date_time_get_timezone_abbreviation
|
||||
g_date_time_is_daylight_savings
|
||||
|
||||
|
@ -2566,6 +2566,24 @@ g_date_time_get_utc_offset (GDateTime *datetime)
|
||||
return (gint64) offset * USEC_PER_SECOND;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_date_time_get_timezone:
|
||||
* @datetime: a #GDateTime
|
||||
*
|
||||
* Get the time zone for this @datetime.
|
||||
*
|
||||
* Returns: (transfer none): the time zone
|
||||
* Since: 2.58
|
||||
*/
|
||||
GTimeZone *
|
||||
g_date_time_get_timezone (GDateTime *datetime)
|
||||
{
|
||||
g_return_val_if_fail (datetime != NULL, NULL);
|
||||
|
||||
g_assert (datetime->tz != NULL);
|
||||
return datetime->tz;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_date_time_get_timezone_abbreviation:
|
||||
* @datetime: a #GDateTime
|
||||
|
@ -244,6 +244,8 @@ gboolean g_date_time_to_timeval (GDateTi
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GTimeSpan g_date_time_get_utc_offset (GDateTime *datetime);
|
||||
GLIB_AVAILABLE_IN_2_58
|
||||
GTimeZone * g_date_time_get_timezone (GDateTime *datetime);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
const gchar * g_date_time_get_timezone_abbreviation (GDateTime *datetime);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
|
Loading…
Reference in New Issue
Block a user