There are four options available to configure the system time, date, and time zone on your Speedgoat target computer:
- Option 1: Using "speedgoat.setTargetTime"
- Option 2: Using SLRT Explorer (R2025a+)
- Option 3: Use "tg.setTargetTime" and "tg.setTargetTimezone"(R2025a+)
- Option 4: Manual configuration from target console
NOTE: Setting the time zone is generally only required for synchronization workflows with external hardware, such as PTP. Simulink Real-Time itself defaults to UTC for the status monitor display, the SLRT log, and file logging timestamps, even if a different time zone is set on the Speedgoat system.
Option 1: Using "speedgoat.setTargetTime"
You can synchronize the Speedgoat system time and date with the host PC using the "speedgoat.setTargetTime" function from the Speedgoat I/O Blockset:
>> speedgoat.setTargetTime;
By default, "speedgoat.setTargetTime" automatically synchronizes the time to match the host PC's time, while setting the time zone to GMT. See the Speedgoat documentation for more information:
Option 2: Using SLRT Explorer (R2025a+)
Starting in R2025a, you can set the target computer time from the host computer by using the Simulink Real-Time Explorer. Use the 'Set Target Time' button on the Target Configuration tab to set the date, time, and time zone of the target computer, the latter of which you can select from a drop-down menu. Note that the "Set Target Time" button is grayed out while a real-time application is running or loaded.
Option 3: Use "tg.setTargetTime" and "tg.setTargetTimezone"(R2025a+)
Starting in R2025a, you can get and set the target computer date, time, and timezone using the following MATLAB functions:
These functions require you to explicitly set the time zone. For the default UTC time zone, use "Universal":
>> tg = slrealtime;
>> connect(tg);
>> setTargetTimezone(tg,"Universal");
>> newTime = datetime("now");
>> setTargetTime(tg,newTime);
>> getTargetTime(tg)
ans =
'Sat May 17 13:19:56 GMT 2025'
.
Option 4: Manual configuration from target console
You can manually set the system date, time, and time zone from the target computer's command line via SSH. For instructions on establishing the SSH connection, see the MathWorks documentation:
To run the system commands to set the date, time, and time zone, log in as user root by using password root.
IMPORTANT NOTE: Do not change the target time or time zone while a real-time application is running or loaded.
This example sets the time zone to Eastern Standard Time:
$ env TZ=EST5EDT
$ export TZ=EST5EDT
$ setconf _CS_TIMEZONE EST5EDT
This example sets the date and time to September 10, 2024 at 11:25 AM.
$ date 091011252024
Tue Sep 10 11:25:15 EDT 2024
Refer to the QNX Neutrino 7.1 documentation regarding the used system commands:
Please note that setting the timezone requires a database of timezone information. You can find details on accessing and downloading this database towards the end of the QNX timezone documentation.