ICalGLib.Timezone

g GObject.Object GObject.Object ICalGLib.Object ICalGLib.Object GObject.Object->ICalGLib.Object ICalGLib.Timezone ICalGLib.Timezone ICalGLib.Object->ICalGLib.Timezone

Subclasses:

None

Methods

Inherited:

ICalGLib.Object (11), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

array_append_from_vtimezone (timezones, child)

class

array_element_at (timezones, index)

class

array_new ()

class

free_builtin_timezones ()

class

free_zone_directory ()

class

get_builtin_timezone (location)

class

get_builtin_timezone_from_offset (offset, tzname)

class

get_builtin_timezone_from_tzid (tzid)

class

get_builtin_timezones ()

class

get_builtin_tzdata ()

class

get_location_from_vtimezone (component)

class

get_tznames_from_vtimezone (component)

class

get_utc_timezone ()

class

get_zone_directory ()

class

new ()

class

release_zone_tab ()

class

set_builtin_tzdata (set)

class

set_tzid_prefix (new_prefix)

class

set_zone_directory (path)

copy ()

dump_changes (max_year, fp)

get_component ()

get_display_name ()

get_latitude ()

get_location ()

get_longitude ()

get_tzid ()

get_tznames ()

get_utc_offset (tt)

get_utc_offset_of_utc_time (tt)

set_component (comp)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

ICalGLib.Object (5)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class ICalGLib.Timezone(**kwargs)
Bases:

ICalGLib.Object

Abstract:

No

Structure:

ICalGLib.TimezoneClass

This is the ICalGLib.Timezone instance.

classmethod array_append_from_vtimezone(timezones, child)
Parameters:

Populate the array of timezones with a component.

note The timezones assumes ownership of the child, thus make sure you pass an unowned ICalGLib.Component.

New in version 1.0.

classmethod array_element_at(timezones, index)
Parameters:
Returns:

The ICalGLib.Timezone at the position index in timezones.

Return type:

ICalGLib.Timezone

Gets the ICalGLib.Timezone at specified position in array.

New in version 1.0.

classmethod array_new()
Returns:

Create a new array.

Return type:

ICalGLib.Array

Creates a new array of timezones.

New in version 1.0.

classmethod free_builtin_timezones()

Frees any builtin timezone information.

New in version 1.0.

classmethod free_zone_directory()

Frees memory dedicated to the zonefile directory.

New in version 1.0.

classmethod get_builtin_timezone(location)
Parameters:

location (str or None) – The location representing the timezone

Returns:

The builtin ICalGLib.Timezone with the name of location

Return type:

ICalGLib.Timezone or None

Returns a single builtin timezone, given its Olson city name.

New in version 1.0.

classmethod get_builtin_timezone_from_offset(offset, tzname)
Parameters:
Return type:

ICalGLib.Timezone

Returns a single builtin timezone, given its offset.

New in version 1.0.

classmethod get_builtin_timezone_from_tzid(tzid)
Parameters:

tzid (str or None) – The tzid name

Return type:

ICalGLib.Timezone

Returns a single builtin timezone, given its TZID.

New in version 1.0.

classmethod get_builtin_timezones()
Returns:

An ICalGLib.Array of the builtin ICalGLib.Timezone objects.

Return type:

ICalGLib.Array

Returns a list of builtin timezones.

New in version 1.0.

classmethod get_builtin_tzdata()
Returns:

Whether to use builtin timezones files.

Return type:

bool

Gets whether to use builtin timezones files.

New in version 2.0.

classmethod get_location_from_vtimezone(component)
Parameters:

component (ICalGLib.Component) – The ICalGLib.Component to be queried

Returns:

The location of vtimezone.

Return type:

str

Gets the location of the vtimezone in component.

New in version 2.0.

classmethod get_tznames_from_vtimezone(component)
Parameters:

component (ICalGLib.Component) – The ICalGLib.Component to be queried

Returns:

The name of vtimezone.

Return type:

str

Gets the name of the vtimezone in component.

New in version 2.0.

classmethod get_utc_timezone()
Returns:

The utc ICalGLib.Timezone

Return type:

ICalGLib.Timezone

Returns the UTC timezone.

New in version 1.0.

classmethod get_zone_directory()
Returns:

The path to look for the zonefiles

Return type:

str

Gets the directory to look for the zonefiles.

New in version 3.0.17.

classmethod new()
Returns:

The newly created object of the type ICalGLib.Timezone.

Return type:

ICalGLib.Timezone or None

The constructor of the type ICalGLib.Timezone.

New in version 1.0.

classmethod release_zone_tab()

Frees memory dedicated to the zonefile directory.

New in version 1.0.

classmethod set_builtin_tzdata(set)
Parameters:

set (bool) – Whether to use builtin timezones files

Sets whether to use builtin timezones files.

New in version 2.0.

classmethod set_tzid_prefix(new_prefix)
Parameters:

new_prefix (str) – The ICalGLib.Timezone to be set

Sets the prefix to be used for tzid’s generated from system tzdata. Must be globally unique (such as a domain name owned by the developer of the calling application), and begin and end with forward slashes. Do not change or de-allocate the string buffer after calling this.

New in version 1.0.

classmethod set_zone_directory(path)
Parameters:

path (str) – The path to look for the zonefiles

Sets the directory to look for the zonefiles.

New in version 1.0.

copy()
Returns:

The newly created ICalGLib.Timezone with the same values as self

Return type:

ICalGLib.Timezone

The clone method for ICalGLib.Timezone.

New in version 1.0.

dump_changes(max_year, fp)
Parameters:
  • max_year (int) – Max year

  • fp (object or None) – The file handle

Returns:

1 if success.

Return type:

int

Outputs a list of timezone changes for the given timezone to the given file, up to the maximum year given.

New in version 1.0.

get_component()
Returns:

The VTIMEZONE component of the self.

Return type:

ICalGLib.Component

Returns the VTIMEZONE component of a timezone.

New in version 1.0.

get_display_name()
Returns:

The display name of self

Return type:

str

Gets the display name of the self.

New in version 1.0.

get_latitude()
Returns:

The latitude of the ICalGLib.Timezone

Return type:

float

Returns the latitude of a builtin timezone.

New in version 1.0.

get_location()
Returns:

The location of the ICalGLib.Timezone, or None

Return type:

str or None

Returns the city name of a timezone, or None, when none is set or when self is also None.

New in version 1.0.

get_longitude()
Returns:

The longitude of the ICalGLib.Timezone.

Return type:

float

Returns the longitude of a builtin timezone.

New in version 1.0.

get_tzid()
Returns:

The timezone id, or None

Return type:

str or None

Returns the TZID of a timezone, or None, when none is set or when self is also None.

New in version 1.0.

get_tznames()
Returns:

The timezone name

Return type:

str or None

Returns the TZNAME properties used in the latest STANDARD and DAYLIGHT components. If they are the same it will return just one, e.g. “LMT”. If they are different it will format them like “EST/EDT”. Note that this may also return None.

New in version 1.0.

get_utc_offset(tt)
Parameters:

tt (ICalGLib.Time or None) – The local time

Returns:

UTC offset of the self

is_daylight:

Whether it is day light

Return type:

(int, is_daylight: int)

Calculates the UTC offset of a given local time in the given timezone. It is the number of seconds to add to UTC to get local time. The is_daylight flag is set to 1 if the time is in daylight-savings time.

New in version 1.0.

get_utc_offset_of_utc_time(tt)
Parameters:

tt (ICalGLib.Time) – The local time

Returns:

UTC offset of the self

is_daylight:

Whether it is day light, can be None

Return type:

(int, is_daylight: int)

Calculates the UTC offset of a given UTC time in the given timezone. It is the number of seconds to add to UTC to get local time. The is_daylight flag is set to 1 if the time is in daylight-savings time.

New in version 1.0.

set_component(comp)
Parameters:

comp (ICalGLib.Component) – The VTIMEZONE component of an ICalGLib.Timezone, initializing the tzid, location and tzname fields

Returns:

Whether the action is successful. 1 for success, 0 for failure.

Return type:

int

Sets the VTIMEZONE component of ICalGLib.Timezone, initializing the tzid, location and tzname fields. It returns 1 on success or 0 on failure, i.e. no TZID was found.

note The self assumes ownership of the comp, thus make sure you pass an unowned ICalGLib.Component.

New in version 1.0.