GWeather.Timezone

Fields

None

Methods

class get_by_tzid (tzid)
class get_utc ()
  get_dst_offset ()
  get_name ()
  get_offset ()
  get_tzid ()
  has_dst ()
  ref ()
  unref ()

Details

class GWeather.Timezone

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”.

classmethod get_by_tzid(tzid)
Parameters:tzid (str) – A timezone identifier, like “America/New_York” or “Europe/London”
Returns:A GWeather.Timezone. This object belongs to GWeather, do not unref it.
Return type:GWeather.Timezone

Get the GWeather.Timezone for tzid.

New in version 3.12.

classmethod get_utc()
Returns:a GWeather.Timezone for UTC, or None on error.
Return type:GWeather.Timezone

Gets the UTC timezone.

get_dst_offset()
Returns:self’s daylight/summer time offset, in minutes
Return type:int

Gets self’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.

get_name()
Returns:self’s name
Return type:str

Gets self’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).

get_offset()
Returns:self’s standard offset, in minutes
Return type:int

Gets self’s standard offset from UTC, in minutes. Eg, a value of 120 would indicate “GMT+2”.

get_tzid()
Returns:self’s tzid
Return type:str

Gets self’s tzdata identifier, eg “America/New_York”.

has_dst()
Returns:True if self observes daylight/summer time.
Return type:bool

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

ref()
Returns:self
Return type:GWeather.Timezone

Adds 1 to self’s reference count.

unref()

Subtracts 1 from self’s reference count and frees it if it reaches 0.