Time-related targeting operators

Many segments require choosing an operator (is greater than, is between, is set, contains, etc.) to tell Leanplum how to compare the specified value against the given segment. Below are all of the available operators for time-based parameters and what each of them mean.

  • is past – happened after the given time (session is after 1/2/15)
  • is prior to – happened before the given time (session is before 1/2/15)
  • is since –  happened at or after the give time (session is after 1/2/15)
  • is until –  happened at or before this point (sessions logged before 1/2/15)
  • is not until – did not happen or happened after the given time (sessions did not happen until 1/2/15)
  • is not since – did not happen or happened before the given time (no session after 1/2/15)

To better understand time-related operators, let's look at some examples. For the following examples, we'll assume that today is June 23rd, 2016.

is Since

Last active "is since" 1 week ago. Ran on June 23rd 2016

- Today is June 23rd, if we want time of last active is since 1 week ago. Leanplum will filter all users who were last active at or after 1 week ago, which is Thursday, 16 Jun 2016 00:00:00 PST.  
- Exact filter: "Time of Last Active" >= Thursday, 16 Jun 2016 00:00:00 PST 

Time of first run "is since" 4 days ago. Ran on June 23rd 2016

 

- Today is June 23rd, if we want time of first run "is since" 4 days ago, Leanplum will filter all users whose time of first run is at or after 4 days ago, which is Sunday, 19 Jun 2016 00:00:00 PST

- Exact filter: "Time of first run" >= Sunday, 19 Jun 2016 00:00:00 PST 

Time of first occurrence of register "is since" 1 day ago. Ran on June 23rd 2016

 

- If today is June 23rd and we want Time of first occurrence of the "register" event "is since" 1 day ago, the filter would be "Time of first occurrence" >= 1466578800
- Where 1 day ago is Wednesday, 22 Jun 2016 07:00:00 GMT = June 22 00:00:00 PST = 1466578800

is Prior

Time of first run "is prior" to 2 days ago. Ran on June 23rd 2016

 

- Today is June 23rd, if we want time of first run "is prior" to 2 days ago, Leanplum will filter all users whose time of first run is before 2 days ago, which is Tuesday, 21 Jun 2016 00:00:00 PST.

- Exact filter: "Time of first run" < Tuesday, 21 Jun 2016 00:00:00 PST

Time of first run "is prior" to 24 hours ago. Ran on June 23rd 2016, 7:10pm PST

- Today is June 23rd, 7:10pm PST, if we want time of first run "is prior" to 24 hours ago, Leanplum will filter all users whose time of first run is before 24 hours ago, which is Wednesday, 22 Jun 2016 19:05:11 PST

- Exact filter: "Time of first run" < Wednesday, 22 Jun 2016 19:05:11 PST 

is Between

Time of first run "is between" 7 days ago and 4 days ago. Ran on June 23rd 2016

 

- Today is June 23rd, if we want time of first run "is between" 7 days ago and 4 days ago, Leanplum will filter  all users whose time of first run is between the 16th (7 days ago) and the 19th (4 days ago).

- Exact filter: "Time of first run" >= 1466060400 and "Time of first run" <= 1466319600

Note: Another way to represent this filter would be "Time of first run" >= Thursday, 16 Jun 2016 07:00:00 GMT and "Time of first run" <= Sunday, 19 Jun 2016 07:00:00 GMT
- Where 4 days ago is Sunday, 19 Jun 2016 07:00:00 GMT = Sunday, 19 Jun 2016 00:00:00 PST = 1466319600
- Where 7 days ago is Thursday, 16 Jun 2016 07:00:00 GMT = Thursday, 16 Jun 2016 00:00:00 PST = 1466060400 

Session start in Pacific time "is between" 6/20/2016 8:00am and 6/21/2016 11:59pm

 

- If we want Session start in Pacific time "is between" 6/20/2016 8:00am and 6/21/2016 11:59pm, the filter would be "Time of last session start" >= 1466434800 and "Time of last session start" <= 1466578740

Note: Another way to represent this filter would be "Time of last session start" >= Monday, 20 Jun 2016 08:00:00 PST and "Time of last session start" <= Tuesday, 21 Jun 2016 23:59:00 PST
- Where Monday, 20 Jun 2016 08:00:00 PST = Monday, 20 Jun 2016 15:00:00 GMT = 1466434800
- Where Tuesday, 21 Jun 2016 23:59:00 PST = Wednesday 22 June 2016 06:59:00 GMT = 1466578740

 

is Until 

Last Active "is until" 360 minutes ago. Ran on June 23rd 2:26pm PST

 

- If today is June 23rd 2:26pm PST and we want Last Active "is until" 360 minutes ago, the filter would be "Time of Last Active" <= 1466695560
- Where 360 minutes ago is Thursday, 23 Jun 2016 15:26:00 GMT = Thursday, 23 Jun 2016 08:26:00 PST = 1466695560

is Past

Last Active "is past" 48 hours ago. Ran on June 23 2016 14:33:00 PST

- If today is June 23rd 14:33:00 PST and we want time of last active "is past" 48 hours ago, the filter would be "Time of Last Active" > 1466544780
- Where 48 hours ago is Tuesday, 21 Jun 2016 21:33:00 GMT = Tuesday, 21 Jun 2016 14:33:00 PST = 1466544780


Was this article helpful?
Have more questions? Submit a request