Returns a Date Data
Type based on a day, month, and year.
|
Date := DMY2DATE(Day [, Month] [, Year])
|
Parameters
- Day
-
Type: integer
The number of the day in the month (1-31)
- 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.
- Year
-
Type: integer
The four-digit number of the year. If you omit this optional
parameter, the current year is used as the default.
Property Value/Return Value
Type: date
The resulting date.
Example
This code example requires that you create the
following variables and text constants in the C/AL Globals
window.
Variable name |
DataType |
Day
|
Integer
|
Month
|
Integer
|
Year
|
Integer
|
OutputDate
|
Date
|
Text constant name |
ENU Value |
Text000
|
Day number %1, month number %2, and year number %3 corresponds
to the date %4.
|
|
Copy Code |
Day := 17;
Month := 2;
Year := 2009;
OutputDate := DMY2DATE(Day, Month, Year);
MESSAGE(Text000, Day, Month, Year, OutputDate);
|
On a computer with the regional format set to English
(United States), the message window displays the following:
Day number 17, month number 2, and year number 2009
corresponds to the date 02/17/09.
See Also