TimeCalc

Performs a calculation on times either a frame or the table items inside the frame.

Parameters

NameDefaultMeaning
nameThe name of the final attribute/column
amount100The amount to be changed by. Substitutable.
methodAddadd, sub or perc
startStartTimeThe start/base date to work from
endEndTimeThe end date (used for the 'perc' method)
multiplier1A multiplier to apply

Description

This function performs a calculation on a frame, or - if the frame contains a table - the individual items within the table.

The capture attribute or column named name will be set to the resulting value. If no 'start' or 'end' values are given, these default to the StartTime and EndTime of the frame itself.

If using the Add method, amount x multiplier seconds will be added to the start date.

If using the Sub method, amount x multiplier seconds will be deducted from the start date.

If using the Perc method, a time will be picked amount percentage of the distance between the start and end date.

Example 1

If the frame contains the following attributes…

AttributeValue
StartTime10:20
EndTime10:40
{
   "type": "timecalc",
   "name": "LateStart",
   "amount": 120,
   "method": "add"
}

The final results will include the LateStart attribute that is 10:22 - 120 seconds would have been added.

Example 2

If the frame contains the following attributes…

AttributeValue
StartTime10:20
EndTime10:40
{
   "type": "timecalc",
   "name": "MidTime",
   "amount": 50
   "method": "perc"
}

The final results will include the MidTime attribute that is 10:30 - 50% of the distance between 10:20 and 10:40.