Time Formula Functions

Overview

The timeDiff and timeOffset functions use date-related data to perform a calculation or task. These functions do not require multiple values and do not require relationships, reference variable types, or data from more than one field or formula.

Warning:
 Formulas do not calculate automatically on their own.  A formula will re-calculate whenever a variable referenced by the formula changes in value.


timeDiff

The timeDiff function returns differences between two dates using Date & Time variables or a Date & Time variable and the today function in seconds, days, or hours.

Example: Using the dates May 15, 2018 (variable A) and May 14, 2018 (variable B), this function could return the following:

Unit of Time
Formula
Results
Seconds (default)timeDiff(A,B)86400
HourstimeDiff(A,B,"hours")24
Days*timeDiff(A,B,"days")1
Today's DatetimeDiff(today(),B,"days")1
* The Days formula can only be used as a workflow condition, not with forms, as the formula does not auto-update.

timeOffset

The timeOffset function offsets (adds or subtracts) seconds, days, or months from a Date & Time field variable. The function returns results in Unix (epoch) timestamp format (e.g., May 2018 = 1525132800) Resolver® does not convert the date from Unix format to Standard format. For further information, see the Converting Unix Timestamp Format to Standard Date Format section or Contact Resolver Support for additional information.

Example: Using May 15, 2018 (variable A) as an example, this function could return the following:

Unit of Time
Formula
Results
SecondstimeOffset(A,86400,"seconds")1526495700 (May 16, 2018)
Days*timeOffset(A,2,"days")1526582100 (May 17, 2018)
MonthstimeOffset(A,1,"months")1529087700 (June 15, 2018)
Days* (Subtracted)timeOffset(A,-3,"days")1526150100 (May 12, 2018)
* The Days formula can only be used as a workflow condition, not with forms, as the formula does not auto-update.

Converting Unix Timestamp Format to Standard Date Format

You can convert and display the timeOffset value from Unix Timestamp format to standard date format.

  1. From any of the main Resolver screens, click the System icon in the top right-hand corner of the screen.

System Icon Location

  1. From the Administration Overview screen, select the Object Types tile from the Data Model section.

Administration Overview

  1.  From the Object Types screen, search for an existing Object Type.
  1. Click on an Object Type name to open the Edit Object Type screen.

Click on an Object Type Name

  1. Scroll to the bottom of the screen and select the Formulas tab.

Formulas Tab

  1. Click on a Formula name.

Formula Name Link

  1. From the Edit Formula screen, scroll to the Display section and select Label from the Range as drop-down list.

Select Label from the Range As Field

  1. Click on the Edit icon next to the first entry.

Click on the Edit Icon

  1. Delete the code from the Color drop-down field.
  2. Enter the date using the Standard Date format in the Label field.
  3. Enter the date using Unix Timestamp format in the Max Value field. A Unix Timestamp records the date in seconds.

Filled Out Display Fields

  1. Click on the Checkmark icon to save the formula's display settings.

Checkmark Icon