:right-sidebar: True Timezone =================================================================== .. currentmodule:: gi.repository.ICalGLib .. class:: Timezone(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.ICalGLib.Object`, :class:`~gi.repository.GObject.Object` This is the ICalTimezone instance. Constructors ------------ .. rst-class:: interim-class .. class:: Timezone :no-index: .. classmethod:: array_new() -> ~gi.repository.ICalGLib.Array Creates a new array of timezones. .. versionadded:: 1.0 .. classmethod:: new() -> ~gi.repository.ICalGLib.Timezone | None The constructor of the type :obj:`~gi.repository.ICalGLib.Timezone`\. .. versionadded:: 1.0 Methods ------- .. rst-class:: interim-class .. class:: Timezone :no-index: .. classmethod:: array_append_from_vtimezone(child: ~gi.repository.ICalGLib.Component) -> None Populate the array of timezones with a component. ``note`` The ``timezones`` assumes ownership of the ``child``\, thus make sure you pass an unowned :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param child: The component to be appended to ``timezones`` .. classmethod:: array_element_at(index: int) -> ~gi.repository.ICalGLib.Timezone Gets the :obj:`~gi.repository.ICalGLib.Timezone` at specified position in array. .. versionadded:: 1.0 :param index: The index .. method:: dump_changes(max_year: int, fp: ~typing.Any = None) -> int Outputs a list of timezone changes for the given timezone to the given file, up to the maximum year given. .. versionadded:: 1.0 :param max_year: Max year :param fp: The file handle .. classmethod:: free_builtin_timezones() -> None Frees any builtin timezone information. .. versionadded:: 1.0 .. classmethod:: free_zone_directory() -> None Frees memory dedicated to the zonefile directory. .. versionadded:: 1.0 .. classmethod:: get_builtin_timezone() -> ~gi.repository.ICalGLib.Timezone | None Returns a single builtin timezone, given its Olson city name. .. versionadded:: 1.0 .. classmethod:: get_builtin_timezone_from_offset(tzname: str | None = None) -> ~gi.repository.ICalGLib.Timezone Returns a single builtin timezone, given its offset. .. versionadded:: 1.0 :param tzname: The reference :obj:`~gi.repository.ICalGLib.Timezone` name .. classmethod:: get_builtin_timezone_from_tzid() -> ~gi.repository.ICalGLib.Timezone Returns a single builtin timezone, given its TZID. .. versionadded:: 1.0 .. classmethod:: get_builtin_timezones() -> ~gi.repository.ICalGLib.Array Returns a list of builtin timezones. .. versionadded:: 1.0 .. classmethod:: get_builtin_tzdata() -> bool Gets whether to use builtin timezones files. .. versionadded:: 2.0 .. method:: get_component() -> ~gi.repository.ICalGLib.Component Returns the VTIMEZONE component of a timezone. .. versionadded:: 1.0 .. method:: get_display_name() -> str Gets the display name of the ``zone``\. .. versionadded:: 1.0 .. method:: get_latitude() -> float Returns the latitude of a builtin timezone. .. versionadded:: 1.0 .. method:: get_location() -> str | None Returns the city name of a timezone, or :const:`None`, when none is set or when ``zone`` is also :const:`None`. .. versionadded:: 1.0 .. classmethod:: get_location_from_vtimezone() -> str Gets the location of the vtimezone in component. .. versionadded:: 2.0 .. method:: get_longitude() -> float Returns the longitude of a builtin timezone. .. versionadded:: 1.0 .. method:: get_tzid() -> str | None Returns the TZID of a timezone, or :const:`None`, when none is set or when ``zone`` is also :const:`None`. .. versionadded:: 1.0 .. method:: get_tznames() -> str | 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 NULL. .. versionadded:: 1.0 .. classmethod:: get_tznames_from_vtimezone() -> str Gets the name of the vtimezone in component. .. versionadded:: 2.0 .. method:: get_utc_offset(tt: ~gi.repository.ICalGLib.Time | None = None) -> tuple[int, 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. .. versionadded:: 1.0 :param tt: The local time .. method:: get_utc_offset_of_utc_time(tt: ~gi.repository.ICalGLib.Time) -> tuple[int, 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. .. versionadded:: 1.0 :param tt: The local time .. classmethod:: get_utc_timezone() -> ~gi.repository.ICalGLib.Timezone Returns the UTC timezone. .. versionadded:: 1.0 .. classmethod:: get_zone_directory() -> str Gets the directory to look for the zonefiles. .. versionadded:: 3.0.17 .. classmethod:: release_zone_tab() -> None Frees memory dedicated to the zonefile directory. .. versionadded:: 1.0 .. classmethod:: set_builtin_tzdata() -> None Sets whether to use builtin timezones files. .. versionadded:: 2.0 .. method:: set_component(comp: ~gi.repository.ICalGLib.Component) -> int Sets the VTIMEZONE component of :obj:`~gi.repository.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 ``zone`` assumes ownership of the ``comp``\, thus make sure you pass an unowned :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param comp: The VTIMEZONE component of an :obj:`~gi.repository.ICalGLib.Timezone`\, initializing the tzid, location and tzname fields .. classmethod:: set_tzid_prefix() -> None 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. .. versionadded:: 1.0 .. classmethod:: set_zone_directory() -> None Sets the directory to look for the zonefiles. .. versionadded:: 1.0