{"title":"System.Date2DMY(Date, Integer) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/system/system-date2dmy-method/","by":"JOP-AL","license":"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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-date2dmy-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Gets the day, month, or year of a Date Data Type.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"System.Date2DMY(Date, Integer) Method","slug":"systemdate2dmydate-integer-method","at":0,"chars":1275},{"level":2,"title":"Syntax","slug":"syntax","at":150,"chars":151},{"level":2,"title":"Parameters","slug":"parameters","at":301,"chars":297},{"level":2,"title":"Return Value","slug":"return-value","at":598,"chars":58},{"level":2,"title":"Example","slug":"example","at":656,"chars":485},{"level":2,"title":"Related information","slug":"related-information","at":1141,"chars":134}],"text":"# System.Date2DMY(Date, Integer) Method\n> Version: _Available or changed with runtime version 1.0._\nGets the day, month, or year of a Date Data Type.\n## Syntax\n```al\nNumber :=   System.Date2DMY(Date: Date, Value: Integer)\n```\n> NOTE\n> This method can be invoked without specifying the data type name.\n## Parameters\nDate\nType: ../date/date-data-type\nThe input date.\nValue\nType: ../integer/integer-data-type\nSpecifies what the method should return. The valid options are 1, 2, and 3.\n The value 1 corresponds to Day (1-31).\n The value 2 corresponds to Month (1-12).\n The value 3 corresponds to Year.\n## Return Value\nNumber\nType: ../integer/integer-data-type\n## Example\nThis example shows how to use the Date2DMY method.\n```al\nvar\n    InputDate: Date;\n    Day: Integer;\n    Month: Integer;\n    Year: Integer;\n    Text000: Label 'Today is day %1 of month %2 of the year %3.';\nbegin\n    InputDate := Today;\n    Day := Date2DMY(InputDate,1);\n    Month := Date2DMY(InputDate,2);\n    Year := Date2DMY(InputDate,3);\n    Message(Text000,Day,Month,Year);\nend;\n```\nThe message window displays the following:\nToday is day 16 of month 2 of the year 2014.\n## Related information\nsystem-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}