StartOfInterval Method (PITimeFormat Object)


See Also     Example         

 

The StartOfInterval method, given an interval name, returns a date for the start of the interval that encloses this object's time value.

 

Syntax

object.StartOfInterval IntervalName

The StartOfInterval method syntax has these parts:

Part Description
object An object expression that evaluates to a PITimeFormat object.
IntervalName An interval name or index from the TimeIntervals collection to which the object's time should be truncated.

 

Remarks

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 StartOfInterval method is to find the month in which a given time falls. For the time 13-Feb-02 6:30, the StartOfInterval for month would give the date 1-Feb-02 00:00 and the StartOfInterval for day would give the date 13-Feb-02 00:00.

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error Description
tseNAMENOTFOUND The specified interval name was not found.
tseOUTOFRANGE The specified interval index was outside the number of items in the collection.

Enabling Operational Intelligence