Compose(
Year: Integer;
Month: Integer;
Day: Integer;
Hour: Integer;
Minute: Integer;
Second: Integer;
Millisecond: Integer): DateTime;
Year. Initial year.
Month. Initial month.
Day. Initial day.
Hour. Initial hour.
Minute. Initial minute.
Second. Initial second.
Millisecond. Initial millisecond.
The Compose method creates a date and time value from the specified input parameters.
The specified date and time components must correspond to the available range that is set for the DateTime data type. If the date that is less than the available one is specified, the date, to which the current century is added, is automatically formed. If the date that is greater than the available one is specified, exception is thrown.
Sub Main;
Var
DT: DateTime;
Begin
DT := DateTime.Compose(2004, 1, 21, 14, 20, 5, 15);
End Sub Main;
After executing the example the "DT" variable will contain the date 21.01.2004 and time 14:20:05.
See also: