Using Relative Time Phrases

Mike Jones
Mike Jones
  • Updated

Relative Time Phrases can be used in Syncari functions when evaluating or updating date and datetime data types. Use a Relative Time Phrase when you need a date or datetime value relative to the current date or datetime.

 

The relative time phrase construct has three parts to it:

  1. Operators: before or after.
  2. Amount: an integer value.
  3. Qualifier: the unit of time. Valid time units are: second/seconds, minute/minutes, day/days, week/weeks, month/months, and year/years.

Relative Time Phrase Examples

before 10 minutes
This will resolve to the current date/time minus 10 minutes.

after 10 minutes
This will resolve to the current date/time plus 10 minutes.

before 1 days
This will resolve to the current date/time minus 1 days.

after 7 days
This will resolve to the current date/time plus 7 days.

before 0 seconds
This will resolve to the current date/time.

 

Using Relative Time in a Condition

You can use a relative time phrase to set up a Decision or Lookup condition that will compare a date or datetime field value against a relative time.

Here's an example that will check if a datetime field is before the current datetime. Using the relative time phrase "before 0 seconds" will return the current datetime

Screen_Shot_2021-10-20_at_3.59.49_PM.png

Using Relative Time in a Set Value, Create Syncari Record or Update Syncari Record Function

A date or datetime field can be updated to a date/datetimevalue relative to the current time by using a relative time phrase. 

For example, if you would like to set a datetime field to the current datetime you could set the new value to "before 0 seconds". Using '0' as the value is the key part of the relative time phrase that will set the value to the current time. The relative time phrase can be used on any function that is configured to update a date or datetime value. 

Here's an example of how to use it on the Set Value function:

Screen_Shot_2021-10-20_at_4.48.34_PM.png

 

 

Share this

Was this article helpful?

0 out of 0 found this helpful