find_interval


Description:

public int find_interval (TimeType type, int64 time)

Finds an interval within this 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:

this

a TimeZone

type

the TimeType of time_

time_

a number of seconds since January 1, 1970

Returns:

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