System.DMY2Date(Integer [, Integer] [, Integer]) Method

Version: Available or changed with runtime version 1.0.

Gets a Date object based on a day, month, and year.

Syntax

Date :=   System.DMY2Date(Day: Integer [, Month: Integer] [, Year: Integer])

Note

This method can be invoked without specifying the data type name.

Parameters

Day
 Type: Integer
The number of the day in the month (1-31)

[Optional] Month
 Type: Integer
The number of the month in the year (1-12). If you omit this optional parameter, the current month will be used as the default.

[Optional] Year
 Type: Integer
The four-digit number of the year. If you omit this optional parameter, the current year is used as the default.

Return Value

Date
 Type: Date

Example

var
    Day: Integer;
    Month: Integer;
    Year: Integer;
    OutputDate: Date;
    Text000: Label "Day number %1, month number %2, and year number %3 corresponds to the date %4.";  
begin  
    Day := 17;  
    Month := 2;  
    Year := 2014;  
    OutputDate := DMY2Date(Day, Month, Year);  
    Message(Text000, Day, Month, Year, OutputDate);  
end;

On a computer that has the regional format set to English (United States), the message window displays the following:

Day number 17, month number 2, and year number 2014 corresponds to the date 02/17/14.

System Data Type
Get Started with AL
Developing Extensions