<GTimeZone>

<GTimeZone>

Description

GTimeZone is an opaque structure whose members cannot be accessed directly.

Functions

adjust-time

(define-values (%return) (time-zone:adjust-time self type 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.

This function is similar to g_time_zone_find_interval(), with the difference that it always succeeds (by making the adjustments described below).

In any of the cases where g_time_zone_find_interval() succeeds then this function returns the same value, without modifying time_.

This function may, however, modify time_ in order to deal with non-existent times. If the non-existent local time_ of 02:30 were requested on March 14th 2010 in Toronto then this function would adjust time_ to be 03:00 and return the interval containing the adjusted time.

Parameters

tz

a GTimeZone

Passed as self

type

the GTimeType of time_

Passed as type

time_

a pointer to a number of seconds since January 1, 1970

Passed as time-

find-interval

(define-values (%return) (time-zone:find-interval self type time-))

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

If type is G_TIME_TYPE_UNIVERSAL then this function will always succeed (since universal time is monotonic and continuous).

Otherwise time_ is treated as local time. The distinction between G_TIME_TYPE_STANDARD and G_TIME_TYPE_DAYLIGHT is ignored except in the case that the given time_ is ambiguous. In Toronto, for example, 01:30 on November 7th 2010 occurred twice (once inside of daylight savings time and the next, an hour later, outside of daylight savings time). In this case, the different value of type would result in a different interval being returned.

It is still possible for this function to fail. In Toronto, for example, 02:00 on March 14th 2010 does not exist (due to the leap forward to begin daylight savings time). -1 is returned in that case.

Parameters

tz

a GTimeZone

Passed as self

type

the GTimeType of time_

Passed as type

time_

a number of seconds since January 1, 1970

Passed as time-

get-abbreviation

(define-values (%return) (time-zone:get-abbreviation self interval))

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

For example, in Toronto this is currently "EST" during the winter months and "EDT" during the summer months when daylight savings time is in effect.

Parameters

tz

a GTimeZone

Passed as self

interval

an interval within the timezone

Passed as interval

get-identifier

(define-values (%return) (time-zone:get-identifier self))

Get the identifier of this GTimeZone, as passed to g_time_zone_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.

The identifier will be returned in the same format as provided at construction time: if provided as a time offset, that will be returned by this function.

Parameters

tz

a GTimeZone

Passed as self

get-offset

(define-values (%return) (time-zone:get-offset self interval))

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

The offset is the number of seconds that you add to UTC time to arrive at local time for tz (ie: negative numbers for time zones west of GMT, positive numbers for east).

Parameters

tz

a GTimeZone

Passed as self

interval

an interval within the timezone

Passed as interval

is-dst?

(define-values (%return) (time-zone:is-dst? self interval))

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

Parameters

tz

a GTimeZone

Passed as self

interval

an interval within the timezone

Passed as interval

ref

(define-values (%return) (time-zone:ref self))

Increases the reference count on tz.

Parameters

tz

a GTimeZone

Passed as self

unref

(define-values () (time-zone:unref self))

Decreases the reference count on tz.

Parameters

tz

a GTimeZone

Passed as self

time-zone:new-utc

(define-values (%return) (time-zone:new-utc))

Undocumented

time-zone:new-offset

(define-values (%return) (time-zone:new-offset seconds))

Undocumented

Parameters

seconds

Passed as seconds

time-zone:new-local

(define-values (%return) (time-zone:new-local))

Undocumented

time-zone:new-identifier

(define-values (%return) (time-zone:new-identifier identifier))

Undocumented

Parameters

identifier

Passed as identifier

time-zone:new

(define-values (%return) (time-zone:new identifier))

Undocumented

Parameters

identifier

Passed as identifier