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 is 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 occured 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. Since 2.26

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