TimeZone.findInterval

Finds an the 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.

class TimeZone
int
findInterval

Parameters

type GTimeType

the #GTimeType of @time_

time long

a number of seconds since January 1, 1970

Return Value

Type: int

the interval containing @time_, or -1 in case of failure

Meta

Since

2.26