The IntervalNumber method, given an interval name, returns the ordinal number of the interval that encloses this object's time value.
The IntervalNumber method syntax has these parts:
|object||An object expression that evaluates to a PITimeFormat object.|
|IntervalName||An interval name or index from the TimeIntervals collection.|
The Ordinal property of TimeInterval objects produces the same result as the IntervalNumber property.
The PITimeFormat object will use the currently set time zone property or the system default if none is set.
An example of the use for IntervalNumber method is to find the month in which a given time falls. For the time 13-Feb-02 6:30, the IntervalNumber for Month would give the number 2 and the IntervalNumber for Day would give the number 13.
In addition to generic errors (such as Out of Memory), the following errors may occur:
|tseNAMENOTFOUND||The specified interval name was not found.|
|tseOUTOFRANGE||The specified interval index was outside the number of items in the collection.|