Last modified November 12, 2018 by Shelly Wolfe

How do I target my audience using date user properties?

As of Swrve SDK version 4.7, target and track your audience based on the date and time of custom user properties with date-typed user properties. For example, target users who have an upcoming event, such as a flight or concert, or ask customers to leave a review a few days after an event, such as checking out of a hotel or purchasing an item.

DateTime user property

For information on how to implement custom DateTime user properties in your app, see the related integration guide:

This article describes the time frames associated with DateTime filter operators. It also includes examples of how to use custom DateTime user properties to target or segment your users. For more information about how to use the available segment and audience filters, see Segment and audience filters.


Filter time frames

For DateTime targeting purposes, one day equals a 24-hour sliding window. The following examples show how a property would match the selected filter, where the point of evaluation for in-app campaigns is session start and the point of evaluation for push notification campaigns is the scheduled time of the push.

Example Time frame
Property is 1 day ago. The property DateTime is within a 24-48 hour window prior to the point of evaluation.
Property is 1 day away. The property DateTime is within a 24-48 hour window after the point of evaluation.
Property is 2 days ago. The property DateTime is within a 48-72 hour window prior to the point of evaluation.
Property is 2 days away. The property DateTime is within a 48-72 hour window after the point of evaluation.
Property is not 2 days ago. The property DateTime falls outside of the 48-72 hour window prior to the point of evaluation.
Property is not 2 days away. The property DateTime falls outside of the 48-72 hour window after the point of evaluation.
Property is between 1 and 2 days away. The property DateTime is within a 24-48 hour window from the time of evaluation.
Property is between 1 and 2 days ago. The property DateTime is within a 24-48 hour window prior to the time of evaluation.
Property is not between 1 and 2 days away. The property DateTime falls outside of the 24-48 hour window from the time of evaluation.
Property is not between 1 and 2 days ago. The property DateTime falls outside of the 24-48 hour window prior to the time of evaluation.
Property is date November 12, 2018 PST. The property DateTime is between 00:00 and 23:59:59:59 on the selected date, in the selected time zone.
Property is date between November 12, 2018 9:30am PST to November 12, 2018 9:30am PST. The property DateTime is between the dates and times selected, in the selected time zone.

Time zones

If using the is date or is date between filter operators, note the following points about time zones:

  • The customer’s device logs the property DateTime in a set time zone (for example, PST). For targeting purposes, the SDK converts the value to UTC when sending the DateTime to Swrve (for example, UTC-8:00).
  • The filter in the audience builder defaults to your company time zone. If you select the same time zone as the property’s time zone (for example, America/Los_Angeles), the system again converts the DateTime to UTC and the values will match.
  • If you select a filter time zone that is different than the property’s time zone, the DateTime may not match the targeted time frame. For example, if the property is set to EST but the audience filter is set to PST, there could be a possible mismatch of three hours.

Targeting DateTime user properties

This section covers some common use cases for targeting DateTime user properties.

Target an upcoming event

Use this example to target customers who have an upcoming event, such as a flight, to encourage them to check in or book a seat.

DateTime example of booked flights

Target a recent purchase

Use this example to target customers who made a recent purchase, to prompt them to review their purchase.

DateTime example recent purchase

Target a specific date range

Use this example to target customers within a specific date range; for example, to notify them of an airport strike.

DateTime example of range of dates


Recurring push notifications

You can also use DateTime properties to target your recurring push campaigns.

Date time user property with recurring push

When using date user properties to target a recurring push audience, ensure the user property you select includes DateTime information, otherwise your targeted audience will be zero.

The following examples show the time frames associated with the different scheduling options for recurring push notifications. In this example, the property DateTime is seven days away and the company time zone is PST (UTC-8). For evaluation and scheduling purposes, Swrve converts all times to UTC.

Option 1: Schedule the notification at the same time worldwide

Recurring push daily frequency at same time worldwide

  • The point of evaluation is the scheduled time, converted to UTC. For example, 16:55 UTC.
  • Every day at 16:55 UTC, Swrve calculates the target audience, checking if the property DateTime is within 168 (24 x 7) and 192 (24 x 8) hours from the time of calculation.
  • If the property DateTime is in that range, the user is sent the push notification.

Option 2: Schedule the notification at the user’s local time

Recurring push daily frequency at users local time

  • The point of evaluation is at the scheduled time in the company’s time zone, converted to UTC. For example, 16:55 UTC.
  • Every day at 16:55 UTC, Swrve calculates the target audience, checking if the property DateTime is within the 168-192 hour window from the time of calculation.
  • If the property DateTime is within that range, the user is sent the push notification at the scheduled time in their local time zone.

Option 3: Schedule the notification at the user’s optimal time between 8am and 9pm

Recurring push daily frequency at users optimal time

  • The point of evaluation is midnight in the company’s time zone, converted to UTC. For example, 8:55 UTC.
  • Every day at 8:55 UTC, Swrve calculates the target audience, checking if the property DateTime is within the 168-192 hour window from the time of calculation.
  • If the property DateTime is within that range, the user is sent the push notification at their optimal time between 8am and 9pm, in their local time zone.

Option 4: Schedule the notification at the user’s optimal time over a 24-hour period

  • The point of evaluation is midnight in the company’s time zone, converted to UTC. For example, 8:55 UTC.
  • Every day at 8:55 UTC, Swrve calculates the target audience, checking if the property DateTime is within the 168-192 hour window from the time of calculation.
  • If the property DateTime is within that range, the user is sent the push notification at their optimal time over a period of 24 hours, in their local time zone.