Version: Available or changed with runtime version 1.0.
Gets and sets the work date for the current session.
[WorkDate := ] System.WorkDate([NewDate: Date])
This method can be invoked without specifying the data type name.
The new work date you want to set.
To set the work date to follow the calendar day so that the work date is always the current date, set NewDate to
0D. If you explicitly set NewDate to the current date, then the work date will also follow the calendar day.
This example shows how to use the WorkDate method.
var NewDate: Date; Text000: Label 'The new work date is: %1'; begin NewDate := WorkDate(20180101D); Message(Text000, NewDate); end;
The 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:
The work date is: 01/01/18