Overview
Time Operators let you send messages relative to a specific moment in time—such as after an action happens or before an upcoming date. You store that moment as a Unix timestamp (in seconds) on the user using a Tag. OneSignal then compares the current time to that timestamp and lets you target users based on how much time has passed (or how much time remains). This makes it easy to automate messages like reminders, follow-ups, and deadlines without scheduling messages manually. Common use cases:- Abandoned cart: Remind users who haven’t checked out after a certain time
- Event reminders: Message users before a scheduled appointment or renewal date
- Milestones: Follow up when users haven’t completed an action by a deadline
- Birthdays: Send automated messages on (or around) a user’s birthday
Time Operators are only available on paid plans. Free plans can still use
default time-based segment filters like First Session and Last Session.
When should I use this?
Use Time Operators when you want to:- Send messages relative to an event, not at a fixed calendar time
- Create moving time windows (for example, “24–48 hours after”)
- Reuse the same logic for many users with different dates
- Continuously evaluate eligibility as time passes
Tags vs Custom Events
You can solve many “reminder” use cases with either Tags or Custom Events. The best option depends on what you need to store and how you want to trigger automation.- Use Tags when you want to store the latest known timestamp on the user (for example,
cart_updated_atorsubscription_expires_at) and segment off that value over time. - Use Custom Events when you want to record each event occurrence (with properties) and trigger Journeys based on real-time behavior.
In practice, many implementations can use both: Custom Events for real-time tracking and Tags for user state you want to segment on later.
| Feature | Tags | Custom Events |
|---|---|---|
| Data usage | Segmentation and personalization | Trigger Journeys without a Segment, Wait Until steps, personalization directly within Journeys |
| Data retention | Lifetime | 30+ days (lifetime storage is available) |
| Data format | Key-value strings or numbers | JSON |
| Data source | OneSignal SDK, API, or integrations (limited) | OneSignal SDK, API, or integrations |
| Data access | Segmentation and message personalization | Journeys and Journey-message-template personalization, Segmentation (Coming soon) |
- Tags for user properties that are static and don’t change often
- Custom Events for real-time scenarios, complex segmentation, and more sophisticated journey workflows
Quick reference
- Convert the event date into a Unix timestamp in seconds.
- Set a Tag where the key is the event name and the value is the timestamp as a string (e.g.,
'event_date': '1739145600'). - Create a segment using the Time Elapsed Greater Than operator:
- After a past date using Time Elapsed Greater Than operator with a positive value
- Before a future date using Time Elapsed Greater Than operator with a negative value
Send messages after a past event
Use this pattern when you want to message users after a certain amount of time has passed since something happened. Example: Abandoned cart reminder 24 hours after the user updated their cartStore the timestamp when the event happens
When the user updates their cart, save the current time as a Unix timestamp (in seconds):
Create a segment
- Go to Audience > Segments
- Add a User Tag filter
- Set Key to
current_time - Choose Time Elapsed Greater Than
- Set Value to
1day (or24hours or86400seconds)

Add an upper limit (Recommended)
Without an upper limit, users stay in the segment forever. Add a second filter to create a window:
- Time Elapsed Greater Than
24hours - Time Elapsed Less Than
48hours

Use the segment in a Journey
Create a Journey that targets your segment to automate the messaging.
Send messages before a future event
Use this pattern to message users leading up to a future date, such as an appointment or renewal.- Store the future date as a Unix timestamp tag (e.g.,
'future_date': '1739145600') - Create a segment with Time Elapsed Greater Than and your desired entry time as a negative value
- Example:
-2days (or-172800seconds)
- Example:

- Add an upper limit using the same Time Elapsed Greater Than operator with a negative value of a closer time
- Example:
-1day (or-86400seconds)
- Example:

Example: Birthday messages
Send birthday messages by storing each user’s next upcoming birthday as a timestamp.Create a birthday segment
- User Tag:
birthday - Time Elapsed Greater Than:
0 seconds

Set up a recurring Journey
- Create a Journey targeting your birthday segment
- Set re-entry to 52 weeks so users can re-enter next year
- Update the
birthdaytag to next year’s date after sending (in your backend or Journey)
Calculate birthday timestamps using the user’s local timezone when possible.
Using server time only may cause messages to send earlier or later than
expected.
Birthday messages will be sent to users around their
birthday tag date.FAQ
How does the math work? (technical details)
Time Operators exist to let you create relative, moving windows instead of fixed dates. OneSignal calculates elapsed time using this formula:- Past timestamps → positive values
- Future timestamps → negative values
Time Elapsed Greater Than X: matches whenelapsed > XTime Elapsed Less Than X: matches whenelapsed < X
Less Than:
Any negative number is less than any positive number. So time_elapsed_lt 2 days (172,800 seconds) will match a timestamp 30 days in the future because:
How can I test?
- Find your user via the External ID, Subscription ID, Email or Phone number. See Find and set test subscriptions for details on finding your user.
- Get a timestamp in seconds of the current date and a future date (5 minutes from now).
- Set two tags with the keys ‘current_time’ and ‘future_time’ and the values as the timestamps in seconds.
- Create a
current_timesegment with the following filters:- User Tag:
current_timeTime Elapsed Greater Than:2minutes - AND User Tag:
current_timeTime Elapsed Less Than:5minutes
- User Tag:
- Create a
future_timesegment with the following filters:- User Tag:
future_timeTime Elapsed Greater Than:-5minutes - AND User Tag:
future_timeTime Elapsed Less Than:-2minutes
- User Tag:
- Enter the
current_timesegment 2 minutes after the current time date and exit the segment 5 minutes after the current time date. - Enter the
future_timesegment 5 minutes before the future time date and exit the segment 2 minutes before the future time date.