timestampOf
New in 8.1.10
This function is used by Ignition's Expression language.
Description​
Returns the timestamp of a qualified value.
Syntax​
timestampOf(value)
Parameters​
Type | Parameter | Description |
---|---|---|
Object | value | The value for which you want to find the timestamp. |
Results​
Date - Returns the timestamp of the value's last update.
Examples​
Code Snippet
timestampOf({[default]Sensor 1/Reading}) //Returns the timestamp of the tag's last value update
Code Snippet
timestampOf(tag("[default]Sensor 1/Reading")) //Returns the timestamp of the tag's value at the time the expression was evaluated on the Gateway
Code Snippet
// Using tag() with a string tagPath
timestampOf(tag("[default]Sensor 1/Reading")) //Example return: 2025-01-23 08:30:00 (evaluated at the Gateway)
// Using a bound value
timestampOf({[default]Sensor 1/Reading}) //Example return: 2025-01-23 08:30:02 (timestamp from the OPC source)
Code Snippet
{[default]Sensor 1/Reading.timestamp} //Directly accesses the tag's timestamp property, returning the timestamp from the OPC source