# 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
```al
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/integer-data-type
The number of the day in the month (1-31)
*[Optional] Month*
Type: ../integer/integer-data-type
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/integer-data-type
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/date-data-type
## Example
```al
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.
## Related information
system-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-dmy2date-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/system/system-dmy2date-method/
