CAPL Script

GetGPSTimeString

This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.

Syntax

void getGPSTimeString(char timeBuffer[], dword timestamp);

Function

Copies a printed representation of the GPS time stamp represented as UTC date and time into the supplied character buffer. The format of the string isddd mmm dd hh:mm:ss jjjj(e.g. "Fri Aug 21 15:22:24 1998").

Parameters

timeBuffer The buffer the string will be written in.This buffer must be at least 26 characters long.

timestamp

The GPS time stamp (seconds have been displayed in time stamps since 1970-01-01, 00:00). The GPS time stamp is available as system variable as soon as a GPS device is configured.

Return Values

—

Reference example from the CANoe 12 help. Check the required configuration, database objects and API availability in your installed version; this is not a recorded compiler or runtime test.

variables
{
  char UTC_time_and_date_buffer[30]; // needs min. 26 chars
  dword UnixTimestamp;
}

on start
{
  getGPSTimeString(UTC_time_and_date_buffer, UnixTimestamp);
}