System.Time() Method

Version: Available or changed with runtime version 1.0.

Gets the current time from the operating system.

Syntax

Time :=   System.Time()

Note

This method can be invoked using property access syntax.

Note

This method can be invoked without specifying the data type name.

Return Value

Time
 Type: Time

Remarks

The time that is returned is different for the Business Central Web client and Dynamics NAV Client connected to Business Central. For the Web client, the time is determined by the Regional Setting that is set under MySetting in the client. The very first time a user signs in, the system automatically determines the Regional Setting based on the user's browser/computer. For the Windows client, Time returns the current day of the computer that is running the client, as determined by the date and time settings of the operating system.

You can only use the Time method to retrieve the time from the operating system. You cannot use it to set the time in the operating system.

Example

var
    Text000: Label 'The current system time is %1.';
begin
    Message(Text000, Time);  
end;

On a computer that has the regional format set to English (United States), the message window could display the following:

The current system time is 11:15:46 AM.

System Data Type
Get Started with AL
Developing Extensions