GWeatherTimezone

GWeatherTimezone

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── GWeatherTimezone

Includes

#include <libgweather/gweather.h>

Description

A timezone.

Timezones are global to the GWeather world (as obtained by gweather_location_get_world()); they can be gotten by passing gweather_timezone_get_by_tzid() with a tzid like "America/New_York" or "Europe/London".

Functions

gweather_timezone_get_type ()

GType
gweather_timezone_get_type (void);

gweather_timezone_get_name ()

const char *
gweather_timezone_get_name (GWeatherTimezone *zone);

Gets zone 's name; a translated, user-presentable string.

Note that the returned name might not be unique among timezones, and may not make sense to the user unless it is presented along with the timezone's country's name (or in some context where the country is obvious).

Parameters

zone

a GWeatherTimezone

 

Returns

zone 's name


gweather_timezone_get_tzid ()

const char *
gweather_timezone_get_tzid (GWeatherTimezone *zone);

Gets zone 's tzdata identifier, eg "America/New_York".

Parameters

zone

a GWeatherTimezone

 

Returns

zone 's tzid


gweather_timezone_get_by_tzid ()

GWeatherTimezone *
gweather_timezone_get_by_tzid (const char *tzid);

Get the GWeatherTimezone for tzid .

Prior to version 40 no reference was returned.

Parameters

tzid

A timezone identifier, like "America/New_York" or "Europe/London"

 

Returns

A GWeatherTimezone.

[transfer full]

Since: 3.12


gweather_timezone_get_offset ()

int
gweather_timezone_get_offset (GWeatherTimezone *zone);

Gets zone 's standard offset from UTC, in minutes. Eg, a value of 120 would indicate "GMT+2".

Parameters

zone

a GWeatherTimezone

 

Returns

zone 's standard offset, in minutes


gweather_timezone_has_dst ()

gboolean
gweather_timezone_has_dst (GWeatherTimezone *zone);

Checks if zone observes daylight/summer time for part of the year.

Parameters

zone

a GWeatherTimezone

 

Returns

TRUE if zone observes daylight/summer time.


gweather_timezone_get_dst_offset ()

int
gweather_timezone_get_dst_offset (GWeatherTimezone *zone);

Gets zone 's daylight/summer time offset from UTC, in minutes. Eg, a value of 120 would indicate "GMT+2". This is only meaningful if gweather_timezone_has_dst() returns TRUE.

Parameters

zone

a GWeatherTimezone

 

Returns

zone 's daylight/summer time offset, in minutes


gweather_timezone_ref ()

GWeatherTimezone *
gweather_timezone_ref (GWeatherTimezone *zone);

Adds 1 to zone 's reference count.

Parameters

zone

a GWeatherTimezone

 

Returns

zone


gweather_timezone_unref ()

void
gweather_timezone_unref (GWeatherTimezone *zone);

Subtracts 1 from zone 's reference count and frees it if it reaches 0.

Parameters

zone

a GWeatherTimezone

 

gweather_timezone_get_utc ()

GWeatherTimezone *
gweather_timezone_get_utc (void);

Gets the UTC timezone.

Returns

a GWeatherTimezone for UTC, or NULL on error.

Types and Values

GWeatherTimezone

typedef struct _GWeatherTimezone GWeatherTimezone;

GWEATHER_TYPE_TIMEZONE

#define GWEATHER_TYPE_TIMEZONE (gweather_timezone_get_type ())