{"title":"System.WorkDate([Date]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/system/system-workdate-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-workdate-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-workdate-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 and sets the work date for the current session.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"System.WorkDate([Date]) Method","slug":"systemworkdatedate-method","at":0,"chars":1288},{"level":2,"title":"Syntax","slug":"syntax","at":146,"chars":144},{"level":2,"title":"Parameters","slug":"parameters","at":290,"chars":99},{"level":2,"title":"Return Value","slug":"return-value","at":389,"chars":67},{"level":2,"title":"Remarks","slug":"remarks","at":456,"chars":244},{"level":2,"title":"Example","slug":"example","at":700,"chars":454},{"level":2,"title":"Related information","slug":"related-information","at":1154,"chars":134}],"text":"# System.WorkDate([Date]) Method\n> Version: _Available or changed with runtime version 1.0._\nGets and sets the work date for the current session.\n## Syntax\n```al\n[WorkDate := ]  System.WorkDate([NewDate: Date])\n```\n> NOTE\n> This method can be invoked without specifying the data type name.\n## Parameters\n*[Optional] NewDate*\nType: ../date/date-data-type\nThe new work date you want to set.\n## Return Value\n*[Optional] WorkDate*\nType: ../date/date-data-type\n## Remarks\nTo set the work date to follow the calendar day so that the work date is always the current date, set NewDate to Today or `0D`. If you explicitly set NewDate to the current date, then the work date will also follow the calendar day.\n## Example\nThis example shows how to use the WorkDate method.\n```al\nvar\n    NewDate: Date;\n    Text000: Label 'The new work date is: %1';\nbegin\n    NewDate := WorkDate(20180101D);\n    Message(Text000, NewDate);\nend;\n```\nThe code sets the work date to January 1, 2018, and returns the new date in a message. On a computer that has the regional format set to English \\(United States\\), the message window displays the following:\nThe work date is: 01/01/18\n## Related information\nsystem-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}