Add or subtract hours or minutes from Time. Other actions can reference the result.
When you execute an Action set to run “Calculate Time,” the result of that calculation is stored internally. You can calculate the time using a formula, such as “=$1.”
If the value of the Base Time parameter is in a format that does not contain a date, the result of the calculation is formatted like 09:30. Seconds are not included. You can set it straight into the Kintone Time field. However, the saved data does not contain time data, so it cannot be exported to a “Date and time” field in Kintone.
If the value of the Base Time parameter includes a date, it is calculated inclusively, and the result is also included in a date format. The resulting format will be based on Coordinated Universal Time, such as 2019-09-06T03:16:00.000Z. This format can be set directly into the Kintone “Date and time” field.
Example: Re-using the calculated time in an Action that runs the Do “Add New Record.”
Set Base Time, Right Hand Side Value, and Calculate Type.
Enter the start time to be used in the calculation.
The format can be time only and no date, such as 09:30, or both date and time, such as 2019-09-12 09:30.
If specified in a format that includes dates, it is calculated inclusively. For example, two hours after 2019-09-12 23:00 will be 2019-09-13 01:00.
If you want to access the value of a “Date” field or a “Date and time” field, input the field code as shown in the example below:
=Time_2
Remember to use an equals sign (=) before the field code to access the value of that field.
Use the syntax below if you want to use the current time.
=now()
This will set the current time as the value of this parameter.
Values that cannot be interpreted as empty values or dates cause an error at runtime.
Specify the number of hours and minutes you want to add as an integer.
For example, if you want to add three hours to the base date, click the “Calculate Type” parameter, select “X Hours After” in the menu and then input the value 3 in the “Right Hand Side Value” parameter.
You can also use negative values. For example, if you set “Right Hand Side Value” to -3 and “Calculate Type” to “X Hours After”, the Do will return the date three hours before the base date.
An empty value causes an error at runtime. A value of zero means no error.
Select from “After XX Hours” or “After XX Minutes.”
For formats that do not contain dates, the result is between 00:00 and 23:59. For example, if you calculate 23:00 plus 2 hours, the result is 01:00 instead of 25:00.
For formats that do not contain a date, the seconds are truncated from the calculation result, even if the Base Time includes them.