SECSDIFF(A,B)
- 1 Minute to read
- Print
- DarkLight
- PDF
SECSDIFF(A,B)
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
DateTime Transform: SECSDIFF(A,B)
Returns difference in seconds between Time for DateTime A and Time for DateTime B
SECSDIFF(A,B) = AbsoluteSeconds(B) - AbsoluteSeconds(A)
Where
AbsoluteSeconds(B) = number of seconds from date reference (where date reference = Jan 0, 0000) to B
AbsoluteSeconds(A) = number of seconds from date reference (where date reference = Jan 0, 0000) to A
Purpose
Use this function to:
- Calculate time between events down to the second
- Calculate the age of an event in seconds
Return Value
Property | Value |
---|---|
FieldType | Integer |
FieldSize | Med / High / Continuous |
DataType | Discrete / Continuous |
DataSize | Integer |
Example Return Value: -N....N where N = Max(AbsoluteSeconds(B) - AbsoluteSeconds(A))
Parameters
Parameter | JSON | Description |
---|---|---|
Table | “targetTable”: “MyTableName” | The target table on which the new field will be created |
Filter | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter Recordset will be returned as null. |
DateTime Function | “p1”: “SECSDIFF(A,B)” | SECSDIFF(A,B) |
A | “p2”: “DateTimeFieldName” “p2”: “#YYYY-MM-DD HH:MM:SS” | Required. DateTime A Supports:
|
B | “p3”: “DateTimeFieldName” “p3”: “#YYYY-MM-DD HH:MM:SS” | Required. DateTime B Supports:
|
JSON Sample
Usage Notes
Any combination of Field/Immediate value is valid for A and B
e.g.,
FieldA/#2019-01-02 00:00:00
#2020-01-02 00:00:00/#2019-01-02 00:00:00
FieldA/FieldB
#2020-01-02 00:00:00/FieldB
See Also:
- HOURSDIFF(A,B) (DateTime)
- MINSDIFF(A.B) (DateTime)
- Engineering | Expression Field
Example
Example | Details |
---|---|
Description | Calculate the number of seconds between purchase and shipping |
Input |
|
Sample |
Was this article helpful?