If you want to define an audience that uses a date attribute in a rule, note that date values are represented as a series of values for each date unit: year, month, and day. When a rule with a date is evaluated, only the individual date unit that is specified is the unit that is changed.

The following example illustrates how rules with date properties are evaluated.

Let’s say that today’s date is May 5, 2017. This date can be expressed in these date units:

Year = 2017
Month =5
Day=5

In a rule with “More than 3 months ago”, “month” is the specified unit, so 3 is subtracted from the month unit:

Year=2017
Month=5 – 3 or 2.
Day=5

Therefore, any date before February 5, 2017 evaluates as “true.”

Months have different numbers of days, so let’s look at another example, where this difference can affect how your rule is evaluated. Let’s say that today is May 30, 2017. In the same rule with “More than 3 months ago,” “month” is still the specified unit, so 3 is again subtracted from the month unit:

Year=2017
Month=5-3 or 2
Day=30

A date of February 30, 2017 does not exist, but the rule can still evaluate dates. In this case all days in February would evaluate as “true.”

Weeks and date attributes

Remember that date values are represented as a series of values for each date unit: year, month, and day. There is no week unit. Weeks are the equivalent of seven days. For example, “more than 3 weeks ago,” is the same as “more than 21 days ago.”

Timestamps and the date attribute

Even though rules do not include timestamps in any of the available rule operators for dates, timestamps do affect how a rule is evaluated.

For example, let’s say that the rule for an audience is “Last Purchase Date is Less than 1 day ago”. The current date and time is March 15, 2017, 12:00 PM GMT. The rule evaluation will calculate a date exactly 1 day from the current date and time, which will be March 14, 2017, 12:00 PM GMT. If Last Purchase Date is equal to March 14, 2017, 11:00 AM GMT, the rule evaluates as “true.” If Last Purchase Date is equal to March 14, 2017, 1:00 PM GMT, the rule evaluates as” false.”

Note that all time is evaluated in GMT.

Between operator in rules with date attributes

Just like with number attributes, when a date attribute uses a Between operator, the operator is inclusive. For the rule to be a match, a value must be between or equal to one of the low and high date values.


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices