TimeZone

A glib.time_zone.TimeZone represents a time zone, at no particular point in time.

The glib.time_zone.TimeZone struct is refcounted and immutable.

Each time zone has an identifier (for example, ‘Europe/London’) which is platform dependent. See glib.time_zone.TimeZone.new_ for information on the identifier formats. The identifier of a time zone can be retrieved using glib.time_zone.TimeZone.getIdentifier.

A time zone contains a number of intervals. Each interval has an abbreviation to describe it (for example, ‘PDT’), an offset to UTC and a flag indicating if the daylight savings time is in effect during that interval. A time zone always has at least one interval — interval 0. Note that interval abbreviations are not the same as time zone identifiers (apart from ‘UTC’), and cannot be passed to glib.time_zone.TimeZone.new_.

Every UTC time is contained within exactly one interval, but a given local time may be contained within zero, one or two intervals (due to incontinuities associated with daylight savings time).

An interval may refer to a specific period of time (eg: the duration of daylight savings time during 2010) or it may refer to many periods of time that share the same properties (eg: all periods of daylight savings time). It is also possible (usually for political reasons) that some properties (like the abbreviation) change between intervals without other properties changing.

Constructors

this
this(string identifier)

A version of glib.time_zone.TimeZone.newIdentifier which returns the UTC time zone if identifier could not be parsed or loaded.

Members

Functions

adjustTime
int adjustTime(glib.types.TimeType type, long time)

Finds an interval within tz that corresponds to the given time_, possibly adjusting time_ if required to fit into an interval. The meaning of time_ depends on type.

findInterval
int findInterval(glib.types.TimeType type, long time)

Finds an interval within tz that corresponds to the given time_. The meaning of time_ depends on type.

getAbbreviation
string getAbbreviation(int interval)

Determines the time zone abbreviation to be used during a particular interval of time in the time zone tz.

getIdentifier
string getIdentifier()

Get the identifier of this #GTimeZone, as passed to glib.time_zone.TimeZone.new_. If the identifier passed at construction time was not recognised, UTC will be returned. If it was null, the identifier of the local timezone at construction time will be returned.

getOffset
int getOffset(int interval)

Determines the offset to UTC in effect during a particular interval of time in the time zone tz.

isDst
bool isDst(int interval)

Determines if daylight savings time is in effect during a particular interval of time in the time zone tz.

Static functions

newIdentifier
glib.time_zone.TimeZone newIdentifier(string identifier)

Creates a #GTimeZone corresponding to identifier. If identifier cannot be parsed or loaded, null is returned.

newLocal
glib.time_zone.TimeZone newLocal()

Creates a #GTimeZone corresponding to local time. The local time zone may change between invocations to this function; for example, if the system administrator changes it.

newOffset
glib.time_zone.TimeZone newOffset(int seconds)

Creates a #GTimeZone corresponding to the given constant offset from UTC, in seconds.

newUtc
glib.time_zone.TimeZone newUtc()

Creates a #GTimeZone corresponding to UTC.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.