# System.Date2DMY(Date, Integer) Method
> Version: _Available or changed with runtime version 1.0._
Gets the day, month, or year of a Date Data Type.
## Syntax
```al
Number :=   System.Date2DMY(Date: Date, Value: Integer)
```
> NOTE
> This method can be invoked without specifying the data type name.
## Parameters
Date
Type: ../date/date-data-type
The input date.
Value
Type: ../integer/integer-data-type
Specifies what the method should return. The valid options are 1, 2, and 3.
 The value 1 corresponds to Day (1-31).
 The value 2 corresponds to Month (1-12).
 The value 3 corresponds to Year.
## Return Value
Number
Type: ../integer/integer-data-type
## Example
This example shows how to use the Date2DMY method.
```al
var
    InputDate: Date;
    Day: Integer;
    Month: Integer;
    Year: Integer;
    Text000: Label 'Today is day %1 of month %2 of the year %3.';
begin
    InputDate := Today;
    Day := Date2DMY(InputDate,1);
    Month := Date2DMY(InputDate,2);
    Year := Date2DMY(InputDate,3);
    Message(Text000,Day,Month,Year);
end;
```
The message window displays the following:
Today is day 16 of month 2 of the year 2014.
## 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-date2dmy-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-date2dmy-method/
