IMsModelPeriod.GetLevelDate

Syntax

GetLevelDate(Index: Integer; Level: DimCalendarLevel): DateTime;

Parameters

Index. Period index.

Level. Period size.

Description

The ObtainLevelDate method returns start date and time for selected period.

Example

Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. This modeling container must include a problem with the OBJ_PROBLEM identifier.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Problem: IMsProblem;
    Details: IMsForecastingProblem;
    Period: IMsModelPeriod;
    stDt, endDt: DateTime;
    count: DateTime;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemByIdNamespace("OBJ_PROBLEM", MB.ItemById("CONT_MODEL").Key).Bind;
    Problem := MObj As IMsProblem;
    Details := Problem.Details As IMsForecastingProblem;
    Period := Details.Period;
    stDt := Period.ForecastStartDate;
    endDt := Period.ForecastEndDate;
    count := Period.GetLevelDate(1, DimCalendarLevel.Day);
    Debug.WriteLine("Second day of problem sample period: " + count.ToString);
End Sub UserProc;

After executing the example, date and time of beginning of the second day of the problem sample period are displayed in the console window.

See also:

IMsModelPeriod