Hi,
An API send me back information with Linux format time stamp as 32 bits Unsigned Integer like:
1689690756 which means "2023-07-18 14:32:36 UTC". In the parameter to retrieve that value, I set "Measurment" as follow:
<Measurement>
<Type options="time">number</Type>
</Measurement>
And the result is: "19556 days 14h 32m 36s". So, its ok for the hours but not for the date. I couldn't find any reference to Linux time in the "SLC_UM_DataMinerDevelopmentLibrary_REV030" manual. So, is there a way to handle linux time in parameters and translate them properly without going through a QAction which could do the job?
Hi Dominique,
As far as I know, there is no direct way of achieving this directly but it could be possible with either a QAction and using the C# DateTime object or alternatively if you do not want to use a QAction you could use a combination of Sequence and DateTime measurement option
You would in essence convert from Unix Time Stamp format to OLE Date format with a set of operations in the Sequence tag and then you would use the DateTime option to make it display as a Date Time in your parameter.
The mathematical expression you need is as follows:
OLE Automation Date = (Unix Timestamp / 86400) + 25569
Where 86400 is the number of seconds in a day and 25569 is the offset between the "origin" dates of each of the formats
Which would translate into
<Sequence noset="true">div:86400;offset:25569</Sequence>
Thank you João,
This indeed a the simplest way so far to handle Linux Time Stamp. So, I apply:
div:86400;offset:25569
And:
number
Which gives the correct result:
19/07/2023 08:45:09, for instance