{"title":"System.DMY2Date(Integer [, Integer] [, Integer]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/system/system-dmy2date-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-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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-dmy2date-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 a Date object based on a day, month, and year.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"System.DMY2Date(Integer [, Integer] [, Integer]) Method","slug":"systemdmy2dateinteger-integer-integer-method","at":0,"chars":1538},{"level":2,"title":"Syntax","slug":"syntax","at":170,"chars":172},{"level":2,"title":"Parameters","slug":"parameters","at":342,"chars":443},{"level":2,"title":"Return Value","slug":"return-value","at":785,"chars":50},{"level":2,"title":"Example","slug":"example","at":835,"chars":569},{"level":2,"title":"Related information","slug":"related-information","at":1404,"chars":134}],"text":"# System.DMY2Date(Integer [, Integer] [, Integer]) Method\n> Version: _Available or changed with runtime version 1.0._\nGets a Date object based on a day, month, and year.\n## Syntax\n```al\nDate :=   System.DMY2Date(Day: Integer [, Month: Integer] [, Year: Integer])\n```\n> NOTE\n> This method can be invoked without specifying the data type name.\n## Parameters\nDay\nType: ../integer/integer-data-type\nThe number of the day in the month (1-31)\n*[Optional] Month*\nType: ../integer/integer-data-type\nThe number of the month in the year (1-12). If you omit this optional parameter, the current month will be used as the default.\n*[Optional] Year*\nType: ../integer/integer-data-type\nThe four-digit number of the year. If you omit this optional parameter, the current year is used as the default.\n## Return Value\nDate\nType: ../date/date-data-type\n## Example\n```al\nvar\n    Day: Integer;\n    Month: Integer;\n    Year: Integer;\n    OutputDate: Date;\n    Text000: Label \"Day number %1, month number %2, and year number %3 corresponds to the date %4.\";\nbegin\n    Day := 17;\n    Month := 2;\n    Year := 2014;\n    OutputDate := DMY2Date(Day, Month, Year);\n    Message(Text000, Day, Month, Year, OutputDate);\nend;\n```\nOn a computer that has the regional format set to English \\(United States\\), the message window displays the following:\nDay number 17, month number 2, and year number 2014 corresponds to the date 02/17/14.\n## Related information\nsystem-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}