Time constants and time units

When you configure a calendar time span or an effective window, you use time constants and time units. Time constants, the starting points of time units, and the end points of irregular time units have specific definitions within Opportunity Detect.

Time units and time constants are calculated relative to the value of Now within the component.

The value of the Now date constant

The value of the Now date constant is calculated relative to the timestamp of the transaction being processed.

When a trigger system starts processing a transaction, the value of the Now time constant is simply the timestamp of the transaction as received from the transaction data source. However, as a trigger system moves through its logic, the value of Now changes as follows.

  • Forward Looking components have a time span that determines how long the component waits after it receives its activating event before it fires its event to activate a child component. The Forward Looking component adds this time span to the transaction timestamp it received, and this becomes the timestamp of the event the Forward Looking component fires.

    This event timestamp is passed as the value of the Now time constant for the immediate child component of the Forward Looking component.

  • Pattern components can be configured to send a negative event when the aging out of an event creates a negative condition. The timestamp of the negative event becomes the value of the Now time constant for the immediate child component of the Forward Looking component of the Pattern component.
  • For an End of Run artificial transaction, the value of Now is the timestamp of the last transaction in the set of data being processed.
  • For an End of Day artificial transaction, the value of Now is 12 A.M. of the next day.

Starting points for calendar time units

The starting points for calendar time units are defined as follows.

  • A calendar week starts at midnight on Sunday.
  • A calendar day starts at midnight.
  • A calendar year starts at midnight of January 1.
  • Calendar quarters start at midnight on January 1, April 1, July 1, and October 1.
  • Beginning of Selected Date is midnight of a day that you select.
  • Minimum Date is 1970-01-01 00:00:00
  • Maximum Date is 2038-01-19 03:14:07

Date constants that return a date

The following date constants return a date.

  • Beginning of current minute
  • Beginning of current hour
  • Beginning of current day
  • Beginning of current week
  • Beginning of current month
  • Beginning of current quarter
  • Beginning of current year
  • Beginning of selected date
  • Maximum date
  • Minimum date

Date constants that return an integer

You might want to use a date constant that returns an integer to determine when a transaction took place. For example, you can create a Boolean expression that returns True when the Current day of the month = 15

The following date constants return an integer.

Table 1. Date constants that return an integer
Date constant Value
Current Second 1 - 60
Current Minute 1 - 60
Current Hour 1 - 24
Current Day of the Month 1 - 31
Current Day of the Week 1 - 7

Sunday = 1

Current Week
  • January 1 = day 1 of week 1
  • In a leap year, December 30 is in week 53
Current Month 1 - 12
Current Quarter 1 - 4
Current Year Four digits