SetTimestamp
The SetTimestamp function returns the value specified by Value and sets its timestamp to the timestamp specified by Timestamp.
Syntax
SetTimestamp( value, timestamp )
Remarks
This function can be useful in applying a timestamp to a value that has no timestamp or an incorrect timestamp. For example, a sensor on the sea floor communicates to a datalogger on a surface buoy. On occasion, the sensor cannot communicate with the datalogger, but continues to take measurements. When communication with the datalogger is reestablished, the measurement data is dumped to the datalogger. The timestamp applied by the datalogger is the time each record is received rather than the time the measurement was taken. However, if the sensor records its own timestamp when measurements are taken, the SetTimestamp function can be used to apply the correct timestamp to each value.
Example
The following example will construct a timestamp from the Year, Month, DayOfMonth, Hour, Minute, and Second values, and then apply that timestamp to the Temp1 value.
SetTimeStamp("Server:CR1000.One_Min.Temp1",ToDate($"" + "Server:CR1000.One_Min.Year" + $"-" + "Server:CR1000.One_Min.Month" + $"-" + "Server:CR1000.One_Min.DayOfMonth" + $" " + "Server:CR1000.One_Min.Hour" + $":" + "Server:CR1000.One_Min.Minute" + $":" + "Server:CR1000.One_Min.Second"))