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 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.
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_at or subscription_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.
Tags and Custom Events are both ways to add data to your users. However, there are some key differences:
Feature
Tags
Custom Events
Data usage
Segmentation and personalization
Segmentation, Journey triggers, Wait Until steps, and personalization within Journeys
Segmentation, Journeys, and Journey-message-template personalization
The key distinction between Tags and Custom Events is in their depth and use cases. Tags are properties of a user, such as Name, Account Status, or Location. Events are thing that the user has done, such as Purchasing an Item, Completing a Level, or Inviting a Friend. Both tags and events can be used for segmentation and personalization.In practice, you will likely use both:
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
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 cart
1
Store the timestamp when the event happens
When the user updates their cart, save the current time as a Unix timestamp (in seconds):
Set re-entry to 52 weeks so users can re-enter next year
Update the birthday tag 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.
If you want messages to stay accurate year-over-year, update the user’s
birthday tag to the next upcoming birthday after you send the message (for
example, in your backend or in a Journey step). Keep in mind, if you do this,
it may be easier to use Custom Events instead.
Birthday messages will be sent to users around their birthday tag date.
Time Operators exist to let you create relative, moving windows instead of fixed dates.OneSignal calculates elapsed time using this formula:
time_elapsed = current_time - tag_timestamp
Past timestamps → positive values
Future timestamps → negative values
Operators:
Time Elapsed Greater Than X: matches when elapsed > X
Time Elapsed Less Than X: matches when elapsed < X
Why future timestamps match immediately with 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:
-2,592,000 < 172,800 → true (matches)
Because future timestamps always produce negative elapsed time, you must use negative values to define when users should enter and exit segments before an upcoming event. Positive values cannot represent time before a future date.
Find your user via the External ID, Subscription ID, Email or Phone number. See Find and set Test Users 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_time segment with the following filters:
User Tag: current_timeTime Elapsed Greater Than: 2 minutes
AND User Tag: current_timeTime Elapsed Less Than: 5 minutes
Create a future_time segment with the following filters:
User Tag: future_timeTime Elapsed Greater Than: -5 minutes
AND User Tag: future_timeTime Elapsed Less Than: -2 minutes
You should see your user:
Enter the current_time segment 2 minutes after the current time date and exit the segment 5 minutes after the current time date.
Enter the future_time segment 5 minutes before the future time date and exit the segment 2 minutes before the future time date.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"OneSignal","description":"OneSignal is a platform for sending push notifications, emails, in-app messages, and SMS campaigns via a single API, Journey Builder, and a dashboard.","colors":{"primary":"#3A3DB3","light":"#E54B4D","dark":"#3A3DB3"},"logo":{"light":"https://mintcdn.com/onesignal/yJcueeDCO7UpHnnY/logo/OneSignal-Logo.svg?fit=max\u0026auto=format\u0026n=yJcueeDCO7UpHnnY\u0026q=85\u0026s=1fcfb6fef6d820fd9d99c74850711107","dark":"https://mintcdn.com/onesignal/s4WC_KzLxf8ornqq/logo/OneSignal-Logo-White.svg?fit=max\u0026auto=format\u0026n=s4WC_KzLxf8ornqq\u0026q=85\u0026s=2573a53b5aea961e18c82b3af8f31925"},"favicon":"https://mintcdn.com/onesignal/SGduBFHpiRdg5l6h/favicon.ico?fit=max\u0026auto=format\u0026n=SGduBFHpiRdg5l6h\u0026q=85\u0026s=c0a99fadc0553c658a83741c5611cef4","api":{"examples":{"languages":["curl","typescript","python","php","go","ruby","java","csharp","rust"],"autogenerate":true}},"navbar":{"links":[{"href":"mailto:support@onesignal.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://dashboard.onesignal.com"}},"footer":{"socials":{"github":"https://github.com/OneSignal","linkedin":"https://linkedin.com/company/onesignal","youtube":"https://www.youtube.com/@onesignalofficial/playlists"}},"seo":{"metatags":{"apple-mobile-web-app-title":"OneSignal Docs"}},"fonts":{"family":"Nunito Sans"},"styling":{"eyebrows":"breadcrumbs","latex":true},"integrations":{"ga4":{"measurementId":"G-2DGWL0VYP5"},"posthog":{"apiKey":"phc_vZpvE0f5eyzcOt30FHer34yddVmNdo9kmlMVRBzLMtn","apiHost":"https://eu.i.posthog.com","sessionRecording":true}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"navigation":{"languages":[{"language":"en","href":"docs/en/home"},{"language":"cn","href":"docs/cn/home"},{"language":"ko","href":"docs/ko/home"},{"language":"ja","href":"docs/ja/home"},{"language":"tr","href":"docs/tr/home"},{"language":"pt-BR","href":"docs/pt-BR/home"},{"language":"es","href":"docs/es/home"},{"language":"fr","href":"docs/fr/home"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"onesignal","hasAudioNarration":false,"actualSubdomain":"onesignal","customDomains":["documentation.onesignal.com"],"gitSource":{"type":"github","owner":"onesignal","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae26fed12c0d34fba01520f","collectionId":"e2a418ee-bdf6-4b1b-bcf7-22047a19afb3","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae26fed12c0d34fba01520f"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae27970d56b3c07efab0978","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"en","tag":"User Guides","count":201},{"language":"es","tag":"Guías del Usuario","count":178},{"language":"fr","tag":"Guides utilisateur","count":178},{"language":"ja","tag":"ユーザーガイド","count":178},{"language":"ko","tag":"사용자 가이드","count":178},{"language":"pt-BR","tag":"Guia do Usuário","count":178},{"language":"tr","tag":"Kullanıcı Kılavuzları","count":178},{"language":"cn","tag":"用户指南","count":176},{"language":"en","tag":"Message channels","count":90},{"language":"es","tag":"Canales de mensajería","count":84},{"language":"fr","tag":"Canaux de messagerie","count":84},{"language":"ja","tag":"メッセージングチャネル","count":84},{"language":"ko","tag":"메시지 채널","count":84},{"language":"pt-BR","tag":"Canais de mensagem","count":84},{"language":"tr","tag":"Mesaj kanalları","count":84},{"language":"cn","tag":"消息渠道","count":83},{"language":"default","tag":"API Reference","count":68},{"language":"default","tag":"API reference","count":64},{"language":"en","tag":"Analytics \u0026 Integrations","count":53},{"language":"es","tag":"Analítica \u0026 Integraciones","count":52},{"language":"fr","tag":"Analyses et intégrations","count":52},{"language":"ja","tag":"分析 \u0026 統合","count":52},{"language":"ko","tag":"분석 \u0026 통합","count":52},{"language":"pt-BR","tag":"Análises \u0026 Integrações","count":52},{"language":"tr","tag":"Analitik ve Entegrasyonlar","count":52},{"language":"cn","tag":"分析和集成","count":51},{"language":"cn","tag":"开发者指南","count":48},{"language":"es","tag":"Guías del desarrollador","count":48},{"language":"fr","tag":"Guides développeur","count":48},{"language":"ja","tag":"開発者ガイド","count":48},{"language":"ko","tag":"개발자 가이드","count":48},{"language":"tr","tag":"Geliştirici Kılavuzları","count":48},{"language":"pt-BR","tag":"Guia de desenvolvedor","count":47},{"language":"en","tag":"Developer Guides","count":46},{"language":"en","tag":"Integrations","count":37},{"language":"es","tag":"Integraciones","count":37},{"language":"fr","tag":"Intégrations","count":37},{"language":"ja","tag":"統合","count":37},{"language":"ko","tag":"통합","count":37},{"language":"pt-BR","tag":"Integrações","count":37},{"language":"tr","tag":"Entegrasyonlar","count":37},{"language":"cn","tag":"集成","count":36},{"language":"en","tag":"Tutorials","count":35},{"language":"cn","tag":"推送通知","count":31},{"language":"cn","tag":"OneSignal 作为目的地","count":31},{"language":"en","tag":"Push","count":31},{"language":"en","tag":"OneSignal as destination","count":31},{"language":"es","tag":"Push notificaciones","count":31},{"language":"es","tag":"OneSignal como destino","count":31},{"language":"fr","tag":"Push","count":31},{"language":"fr","tag":"OneSignal comme destination","count":31},{"language":"ja","tag":"プッシュ通知","count":31},{"language":"ja","tag":"OneSignal as 宛先","count":31},{"language":"ko","tag":"푸시","count":31},{"language":"ko","tag":"OneSignal을 데이터 목적지로 사용","count":31},{"language":"pt-BR","tag":"Push notificações","count":31},{"language":"pt-BR","tag":"OneSignal como destino","count":31},{"language":"tr","tag":"Anlık bildirimler","count":31},{"language":"tr","tag":"OneSignal hedef","count":31},{"language":"cn","tag":"移动SDK","count":25},{"language":"en","tag":"Mobile SDKs","count":25},{"language":"es","tag":"SDKs móviles","count":25},{"language":"fr","tag":"SDK mobiles","count":25},{"language":"ja","tag":"モバイルSDK","count":25},{"language":"ko","tag":"모바일 SDKs","count":25},{"language":"pt-BR","tag":"SDKs móveis","count":25},{"language":"tr","tag":"Mobil SDK'lar","count":25},{"language":"cn","tag":"教程","count":24},{"language":"es","tag":"Tutoriales","count":24},{"language":"fr","tag":"Tutoriels","count":24},{"language":"ja","tag":"チュートリアル","count":24},{"language":"ko","tag":"튜토리얼","count":24},{"language":"pt-BR","tag":"Tutoriais","count":24},{"language":"tr","tag":"Eğitimler","count":24},{"language":"en","tag":"Email","count":19},{"language":"cn","tag":"移动SDK设置","count":18},{"language":"es","tag":"Configuración del SDK móvil","count":18},{"language":"fr","tag":"Configuration SDK mobile","count":18},{"language":"ja","tag":"モバイルSDKセットアップ","count":18},{"language":"ko","tag":"모바일 SDK 설정","count":18},{"language":"pt-BR","tag":"Configuração do SDK móvel","count":18},{"language":"tr","tag":"Mobil SDK kurulumu","count":18},{"language":"default","tag":"Messages","count":9},{"language":"default","tag":"Users","count":9},{"language":"default","tag":"Organization","count":9},{"language":"default","tag":"Journeys","count":8},{"language":"default","tag":"Deprecated","count":6},{"language":"default","tag":"Templates","count":6},{"language":"default","tag":"Subscriptions","count":6},{"language":"default","tag":"Segments","count":5}]},"assistantConfig":{"enableStarterQuestions":false,"deflection":{"enabled":true,"email":"support@onesignal.com","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"docs/en/time-operators","slug":"/docs/en/time-operators","pageMetadata":{"title":"Tags: Time Operators","description":"Automate time-based messages using Time Elapsed operators with Tags that store Unix timestamps in seconds.","keywords":["time operators","time elapsed","unix timestamp","birthday","Time Elapsed Greater Than","Time Elapsed Less Than","cart_updated_at","subscription_expires_at","send message after event","send message before date","renewal reminder","relative time targeting","timestamp in seconds not milliseconds","milliseconds vs seconds","13 digits vs 10 digits","negative value for future date","moving time window","24-48 hour window","users stay in segment forever","segment re-entry 52 weeks","time elapsed formula"],"href":"/docs/en/time-operators"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Automate time-based messages using Time Elapsed operators with Tags that store Unix timestamps in seconds.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Check,CodeBlock,Frame,Heading,Info,Note,OptimizedImage,Step,Steps,Table,Warning}=_components;if(!Check)_missingMdxReference(`Check`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`Time Operators let you send messages relative to a specific moment in time—such as `,_jsx(_components.strong,{children:`after an action happens`}),` or `,_jsx(_components.strong,{children:`before an upcoming date`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`You store that moment as a `,_jsx(_components.strong,{children:`Unix timestamp (in seconds)`}),` on the user using a `,_jsx(_components.strong,{children:`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).`]}),`\n`,_jsx(_components.p,{children:`This makes it easy to automate messages like reminders, follow-ups, and deadlines without scheduling messages manually.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Common use cases:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.a,{href:`/docs/en/abandoned-cart`,children:`Abandoned cart`})}),`: Remind users who haven’t checked out after a certain time`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Event reminders`}),`: Message users before a scheduled appointment or renewal date`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Milestones`}),`: Follow up when users haven’t completed an action by a deadline`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Birthdays`}),`: Send messages on (or around) a user’s birthday`]}),`\n`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Time Operators are only available on paid plans. Free plans can still use\ndefault time-based segment filters like First Session and Last Session.`})}),`\n`,_jsx(Heading,{level:`3`,id:`when-should-i-use-this`,children:`When should I use this?`}),`\n`,_jsx(_components.p,{children:`Use Time Operators when you want to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Send messages `,_jsx(_components.strong,{children:`relative to an event`}),`, not at a fixed calendar time`]}),`\n`,_jsxs(_components.li,{children:[`Create `,_jsx(_components.strong,{children:`moving time windows`}),` (for example, “24–48 hours after”)`]}),`\n`,_jsx(_components.li,{children:`Reuse the same logic for many users with different dates`}),`\n`,_jsx(_components.li,{children:`Continuously evaluate eligibility as time passes`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`If you need to trigger messaging immediately when an event occurs, consider using `,_jsx(_components.strong,{children:_jsx(_components.a,{href:`/docs/en/custom-events`,children:`Custom Events`})}),` instead.`]}),`\n`,_jsx(Heading,{level:`3`,id:`tags-vs-custom-events`,children:`Tags vs Custom Events`}),`\n`,_jsxs(_components.p,{children:[`You can solve many “reminder” use cases with either `,_jsx(_components.strong,{children:`Tags`}),` or `,_jsx(_components.strong,{children:`Custom Events`}),`. The best option depends on what you need to store and how you want to trigger automation.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Use `,_jsx(_components.strong,{children:`Tags`}),` when you want to store the `,_jsx(_components.strong,{children:`latest known timestamp`}),` on the user (for example, `,_jsx(_components.code,{children:`cart_updated_at`}),` or `,_jsx(_components.code,{children:`subscription_expires_at`}),`) and segment off that value over time.`]}),`\n`,_jsxs(_components.li,{children:[`Use `,_jsx(_components.strong,{children:`Custom Events`}),` when you want to record `,_jsx(_components.strong,{children:`each event occurrence`}),` (with properties) and trigger Journeys based on real-time behavior.`]}),`\n`]}),`\n`,_jsx(Info,{children:_jsx(_components.p,{children:`In practice, many implementations can use both: Custom Events for real-time tracking and Tags for user state you want to segment on later.`})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/docs/en/add-user-data-tags`,children:`Tags`}),` and `,_jsx(_components.a,{href:`/docs/en/custom-events`,children:`Custom Events`}),` are both ways to add data to your users. However, there are some key differences:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Feature`}),_jsx(_components.th,{style:{textAlign:`center`},children:`Tags`}),_jsx(_components.th,{style:{textAlign:`center`},children:`Custom Events`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Data usage`}),_jsx(_components.td,{style:{textAlign:`center`},children:`Segmentation and personalization`}),_jsx(_components.td,{style:{textAlign:`center`},children:`Segmentation, Journey triggers, Wait Until steps, and personalization within Journeys`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Data\\xA0retention`}),_jsx(_components.td,{style:{textAlign:`center`},children:`Lifetime`}),_jsxs(_components.td,{style:{textAlign:`center`},children:[`Set per event (`,_jsx(_components.a,{href:`/docs/en/custom-event-storage`,children:`Custom event storage`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Data format`}),_jsx(_components.td,{style:{textAlign:`center`},children:`Key-value strings or numbers`}),_jsx(_components.td,{style:{textAlign:`center`},children:`JSON`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Data source`}),_jsx(_components.td,{style:{textAlign:`center`},children:`OneSignal SDK, API, or CSV import`}),_jsx(_components.td,{style:{textAlign:`center`},children:`OneSignal SDK, API, or integrations`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Data access`}),_jsx(_components.td,{style:{textAlign:`center`},children:`Segmentation and message personalization`}),_jsx(_components.td,{style:{textAlign:`center`},children:`Segmentation, Journeys, and Journey-message-template personalization`})]})]})]}),`\n`,_jsx(_components.p,{children:`The key distinction between Tags and Custom Events is in their depth and use cases. Tags are properties of a user, such as Name, Account Status, or Location. Events are thing that the user has done, such as Purchasing an Item, Completing a Level, or Inviting a Friend. Both tags and events can be used for segmentation and personalization.`}),`\n`,_jsx(_components.p,{children:`In practice, you will likely use both:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Tags for user properties that are static and don’t change often`}),`\n`,_jsx(_components.li,{children:`Custom Events for real-time scenarios, complex segmentation, and more sophisticated journey workflows`}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`quick-reference`,children:`Quick reference`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Convert the event date into a Unix timestamp in `,_jsx(_components.strong,{children:`seconds`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Set a `,_jsx(_components.a,{href:`/docs/en/add-user-data-tags`,children:`Tag`}),` where the key is the event name and the value is the timestamp as a `,_jsx(_components.strong,{children:`string`}),` (e.g., `,_jsx(_components.code,{children:`'event_date': '1739145600'`}),`).`]}),`\n`,_jsxs(_components.li,{children:[`Create a segment using the `,_jsx(_components.strong,{children:`Time Elapsed Greater Than`}),` operator:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`After a past date using `,_jsx(_components.strong,{children:`Time Elapsed Greater Than`}),` operator with a positive value`]}),`\n`,_jsxs(_components.li,{children:[`Before a future date using `,_jsx(_components.strong,{children:`Time Elapsed Greater Than`}),` operator with a negative value`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`A common mistake is setting timestamps in `,_jsx(_components.strong,{children:`milliseconds`}),` (13 digits) instead\nof `,_jsx(_components.strong,{children:`seconds`}),` (10 digits). Time Operators require `,_jsx(_components.strong,{children:`seconds`}),`.`]})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`send-messages-after-a-past-event`,children:`Send messages after a past event`}),`\n`,_jsxs(_components.p,{children:[`Use this pattern when you want to message users `,_jsx(_components.strong,{children:`after a certain amount of time has passed`}),` since something happened.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example: Abandoned cart reminder 24 hours after the user updated their cart`})}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Store the timestamp when the event happens`,children:[_jsx(_components.p,{children:`When the user updates their cart, save the current time as a Unix timestamp (in seconds):`}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// SDK example`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` timestampSeconds`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` String`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Math`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`floor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`now`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`OneSignal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`User`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addTag`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"current_time\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`timestampSeconds`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(Warning,{children:_jsx(_components.p,{children:`Use seconds (10 digits), not milliseconds (13 digits).`})})]}),_jsxs(Step,{title:`Create a segment`,children:[_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Go to `,_jsx(_components.strong,{children:`Audience > Segments`})]}),`\n`,_jsxs(_components.li,{children:[`Add a `,_jsx(_components.strong,{children:`User Tag`}),` filter`]}),`\n`,_jsxs(_components.li,{children:[`Set `,_jsx(_components.strong,{children:`Key`}),` to `,_jsx(_components.code,{children:`current_time`})]}),`\n`,_jsxs(_components.li,{children:[`Choose `,_jsx(_components.strong,{children:`Time Elapsed Greater Than`})]}),`\n`,_jsxs(_components.li,{children:[`Set `,_jsx(_components.strong,{children:`Value`}),` to `,_jsx(_components.code,{children:`1`}),` day (or `,_jsx(_components.code,{children:`24`}),` hours or `,_jsx(_components.code,{children:`86400`}),` seconds)`]}),`\n`]}),_jsx(Frame,{caption:`Segment for users who abandoned their cart more than 24 hours ago`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than.png?fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=fd95aaf5b4ff3d4ebf594af867a594c8`,alt:`Segment using Time Elapsed Greater Than`,\"data-og-width\":`1311`,width:`1311`,\"data-og-height\":`617`,height:`617`,\"data-path\":`images/segments/time-elapsed-greater-than.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than.png?w=280\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=d671c1c807bdac626b9d77b978573f90 280w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than.png?w=560\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=aae3731a26454315d8223d4c1cb3542a 560w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than.png?w=840\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=f4b2a790a1b2e5663226bf33a774e951 840w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than.png?w=1100\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=512a86f5ae13efafec1e10953ff1b793 1100w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than.png?w=1650\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=ac524bce865a4fcc352f2404d50c5989 1650w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than.png?w=2500\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=cc027b247c33d6ebb1a611b14eb2f133 2500w`})})]}),_jsxs(Step,{title:`Add an upper limit (Recommended)`,children:[_jsx(_components.p,{children:`Without an upper limit, users stay in the segment forever. Add a second filter to create a window:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Time Elapsed Greater Than`}),` `,_jsx(_components.code,{children:`24`}),` hours`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Time Elapsed Less Than`}),` `,_jsx(_components.code,{children:`48`}),` hours`]}),`\n`]}),_jsx(_components.p,{children:`Now users are only in the segment between 24-48 hours after the event.`}),_jsx(Frame,{caption:`Segment with a 24-48 hour window`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-less-than.png?fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=3cb973d5b0252683e9f804e4b04a37b4`,alt:`Segment with both Time Elapsed Greater Than and Less Than`,\"data-og-width\":`1292`,width:`1292`,\"data-og-height\":`715`,height:`715`,\"data-path\":`images/segments/time-elapsed-greater-less-than.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-less-than.png?w=280\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=1f789d860aa65226a5b7526dfb0698fa 280w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-less-than.png?w=560\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=d7aff2a31761b556dcd86aadf3be7ade 560w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-less-than.png?w=840\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=1c057a7b76be68e9b642628ce1c834aa 840w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-less-than.png?w=1100\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=998b1c307e0dd6838b8041d5f4e385b5 1100w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-less-than.png?w=1650\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=b157f0e4344ac59e498d389153903754 1650w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-less-than.png?w=2500\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=599b26ee13888c27df6f0d2a09466d1f 2500w`})})]}),_jsx(Step,{title:`Use the segment in a Journey`,children:_jsxs(_components.p,{children:[`Create a `,_jsx(_components.a,{href:`/docs/en/journeys-overview`,children:`Journey`}),` that targets your segment to automate the messaging.`]})})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`send-messages-before-a-future-event`,children:`Send messages before a future event`}),`\n`,_jsxs(_components.p,{children:[`Use this pattern to message users `,_jsx(_components.strong,{children:`leading up to a future date`}),`, such as an appointment or renewal.`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Store the future date as a Unix timestamp tag (e.g., `,_jsx(_components.code,{children:`'future_date': '1739145600'`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Create a segment with `,_jsx(_components.strong,{children:`Time Elapsed Greater Than`}),` and your desired entry time as a negative value`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Example: `,_jsx(_components.code,{children:`-2`}),` days (or `,_jsx(_components.code,{children:`-172800`}),` seconds)`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Frame,{caption:`Segment for users with an upcoming event`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value.png?fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=bea6fe1e5d4a2d3349fe05674946b910`,alt:`Segment using Time Elapsed Greater Than with a negative value`,\"data-og-width\":`1291`,width:`1291`,\"data-og-height\":`618`,height:`618`,\"data-path\":`images/segments/time-elapsed-greater-than-negative-value.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value.png?w=280\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=c2f40440e328b6b19f6c085eecfdca0b 280w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value.png?w=560\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=9e5ebf2373b2fd319435780590caf056 560w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value.png?w=840\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=d3b5f28c57e5e9fa880a5c2b9fcf1907 840w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value.png?w=1100\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=951936127698338208fedae807415505 1100w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value.png?w=1650\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=a80c5863452e9a7016a1114bd56c0ebe 1650w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value.png?w=2500\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=7c228790ea3b69312bfded1e8574e351 2500w`})}),`\n`,_jsxs(_components.ol,{start:`3`,children:[`\n`,_jsxs(_components.li,{children:[`Add an upper limit using the same `,_jsx(_components.strong,{children:`Time Elapsed Greater Than`}),` operator with a negative value of a closer time`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Example: `,_jsx(_components.code,{children:`-1`}),` day (or `,_jsx(_components.code,{children:`-86400`}),` seconds)`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Frame,{caption:`Segment with an upper limit`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value-upper-limit.png?fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=406246bb0136f1997ababc06a638408f`,alt:`Segment using Time Elapsed Greater Than with a negative value and an upper limit`,\"data-og-width\":`1286`,width:`1286`,\"data-og-height\":`703`,height:`703`,\"data-path\":`images/segments/time-elapsed-greater-than-negative-value-upper-limit.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value-upper-limit.png?w=280\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=f59ec90690c56db464b1a9bed8921955 280w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value-upper-limit.png?w=560\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=d5ff4f8f554a308afc342e6f756cc2b1 560w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value-upper-limit.png?w=840\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=640e4647bf31a7b596e1569cb8c3c26b 840w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value-upper-limit.png?w=1100\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=7ebe2426e75694ddb839c0cd36f7e86d 1100w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value-upper-limit.png?w=1650\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=b2120a137340cece0a90fffcb9c682f0 1650w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/time-elapsed-greater-than-negative-value-upper-limit.png?w=2500\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=ff600b403240c64da49f8809708a492c 2500w`})}),`\n`,_jsx(Heading,{level:`3`,id:`example-birthday-messages`,children:`Example: Birthday messages`}),`\n`,_jsxs(_components.p,{children:[`Send birthday messages by storing each user’s `,_jsx(_components.strong,{children:`next upcoming birthday`}),` as a timestamp.`]}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Store the next birthday timestamp`,children:[_jsx(_components.p,{children:`Calculate and store the user’s next upcoming birthday:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getNextBirthday`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`month`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`day`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // month: 0-11 (Jan=0), day: 1-31`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` now`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` birthday`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`now`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getFullYear`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(), `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`month`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`day`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`birthday`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` now`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` birthday`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Date`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`now`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getFullYear`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`month`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`day`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` String`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Math`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`floor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`birthday`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getTime`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Example: January 15th birthday`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`OneSignal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`User`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addTag`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"birthday\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getNextBirthday`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`15`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`]})})})]}),_jsxs(Step,{title:`Create a birthday segment`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`User Tag`}),`: `,_jsx(_components.code,{children:`birthday`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Time Elapsed Greater Than`}),`: `,_jsx(_components.code,{children:`0 seconds`})]}),`\n`]}),_jsx(_components.p,{children:`Users enter the segment once their birthday timestamp passes.`}),_jsx(Frame,{caption:`Birthday segment`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/birthday-segment.png?fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=6f431d2f592779f74a5b4e27045ad984`,alt:`Birthday segment using Time Elapsed Greater Than 0`,\"data-og-width\":`1287`,width:`1287`,\"data-og-height\":`602`,height:`602`,\"data-path\":`images/segments/birthday-segment.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/birthday-segment.png?w=280\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=77520320c3a34aff20a19171955fab92 280w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/birthday-segment.png?w=560\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=014a6a0f6f7e2414c64b472f04f231fb 560w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/birthday-segment.png?w=840\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=b9c5fb0150574953c867c848b1b886bf 840w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/birthday-segment.png?w=1100\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=18ea31001786fe2448ee53b5c0274f80 1100w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/birthday-segment.png?w=1650\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=2a4517aa25935ab401406eb698586b0e 1650w, https://mintcdn.com/onesignal/BIUS_wdfwITxcuxQ/images/segments/birthday-segment.png?w=2500\u0026fit=max\u0026auto=format\u0026n=BIUS_wdfwITxcuxQ\u0026q=85\u0026s=fe140eeb7e5e254992d0057690c81432 2500w`})})]}),_jsx(Step,{title:`Set up a recurring Journey`,children:_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Create a `,_jsx(_components.a,{href:`/docs/en/journeys-overview`,children:`Journey`}),` targeting your birthday segment`]}),`\n`,_jsxs(_components.li,{children:[`Set re-entry to `,_jsx(_components.strong,{children:`52 weeks`}),` so users can re-enter next year`]}),`\n`,_jsxs(_components.li,{children:[`Update the `,_jsx(_components.code,{children:`birthday`}),` tag to next year’s date after sending (in your backend or Journey)`]}),`\n`]})})]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Calculate birthday timestamps using the user’s local timezone when possible.\nUsing server time only may cause messages to send earlier or later than\nexpected.`})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If you want messages to stay accurate year-over-year, update the user’s\n`,_jsx(_components.code,{children:`birthday`}),` tag to the next upcoming birthday after you send the message (for\nexample, in your backend or in a Journey step). Keep in mind, if you do this,\nit may be easier to use `,_jsx(_components.a,{href:`/docs/en/custom-events`,children:`Custom Events`}),` instead.`]})}),`\n`,_jsx(Check,{children:_jsxs(_components.p,{children:[`Birthday messages will be sent to users around their `,_jsx(_components.code,{children:`birthday`}),` tag date.`]})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`faq`,children:`FAQ`}),`\n`,_jsx(Heading,{level:`3`,id:`how-does-the-math-work-technical-details`,children:`How does the math work? (technical details)`}),`\n`,_jsxs(_components.p,{children:[`Time Operators exist to let you create `,_jsx(_components.strong,{children:`relative, moving windows`}),` instead of fixed dates.`]}),`\n`,_jsx(_components.p,{children:`OneSignal calculates elapsed time using this formula:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`time_elapsed = current_time - tag_timestamp`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Past timestamps`}),` → positive values`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Future timestamps`}),` → negative values`]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Operators:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Time Elapsed Greater Than X`}),`: matches when `,_jsx(_components.code,{children:`elapsed > X`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Time Elapsed Less Than X`}),`: matches when `,_jsx(_components.code,{children:`elapsed \u003c X`})]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsxs(_components.strong,{children:[`Why future timestamps match immediately with `,_jsx(_components.code,{children:`Less Than`}),`:`]})}),`\n`,_jsxs(_components.p,{children:[`Any negative number is less than any positive number. So `,_jsx(_components.code,{children:`time_elapsed_lt 2 days`}),` (172,800 seconds) will match a timestamp 30 days in the future because:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`-2,592,000 \u003c 172,800 → true (matches)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Because future timestamps always produce negative elapsed time, `,_jsx(_components.strong,{children:`you must use negative values`}),` to define when users should enter and exit segments before an upcoming event. Positive values cannot represent time `,_jsx(_components.em,{children:`before`}),` a future date.`]}),`\n`,_jsx(Heading,{level:`3`,id:`how-can-i-test`,children:`How can I test?`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Find your user via the External ID, Subscription ID, Email or Phone number. See `,_jsx(_components.a,{href:`/docs/en/test-users`,children:`Find and set Test Users`}),` for details on finding your user.`]}),`\n`,_jsx(_components.li,{children:`Get a timestamp in seconds of the current date and a future date (5 minutes from now).`}),`\n`,_jsx(_components.li,{children:`Set two tags with the keys ‘current_time’ and ‘future_time’ and the values as the timestamps in seconds.`}),`\n`,_jsxs(_components.li,{children:[`Create a `,_jsx(_components.code,{children:`current_time`}),` segment with the following filters:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`User Tag`}),`: `,_jsx(_components.code,{children:`current_time`}),` `,_jsx(_components.strong,{children:`Time Elapsed Greater Than`}),`: `,_jsx(_components.code,{children:`2`}),` minutes`]}),`\n`,_jsxs(_components.li,{children:[`AND `,_jsx(_components.strong,{children:`User Tag`}),`: `,_jsx(_components.code,{children:`current_time`}),` `,_jsx(_components.strong,{children:`Time Elapsed Less Than`}),`: `,_jsx(_components.code,{children:`5`}),` minutes`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`Create a `,_jsx(_components.code,{children:`future_time`}),` segment with the following filters:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`User Tag`}),`: `,_jsx(_components.code,{children:`future_time`}),` `,_jsx(_components.strong,{children:`Time Elapsed Greater Than`}),`: `,_jsx(_components.code,{children:`-5`}),` minutes`]}),`\n`,_jsxs(_components.li,{children:[`AND `,_jsx(_components.strong,{children:`User Tag`}),`: `,_jsx(_components.code,{children:`future_time`}),` `,_jsx(_components.strong,{children:`Time Elapsed Less Than`}),`: `,_jsx(_components.code,{children:`-2`}),` minutes`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`You should see your user:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Enter the `,_jsx(_components.code,{children:`current_time`}),` segment 2 minutes after the current time date and exit the segment 5 minutes after the current time date.`]}),`\n`,_jsxs(_components.li,{children:[`Enter the `,_jsx(_components.code,{children:`future_time`}),` segment 5 minutes before the future time date and exit the segment 2 minutes before the future time date.`]}),`\n`]}),`\n`,_jsx(_components.hr,{})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Tags: Time Operators","description":"Automate time-based messages using Time Elapsed operators with Tags that store Unix timestamps in seconds.","keywords":["time operators","time elapsed","unix timestamp","birthday","Time Elapsed Greater Than","Time Elapsed Less Than","cart_updated_at","subscription_expires_at","send message after event","send message before date","renewal reminder","relative time targeting","timestamp in seconds not milliseconds","milliseconds vs seconds","13 digits vs 10 digits","negative value for future date","moving time window","24-48 hour window","users stay in segment forever","segment re-entry 52 weeks","time elapsed formula"],"href":"/docs/en/time-operators"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[{"title":"When should I use this?","slug":"when-should-i-use-this","depth":3,"children":[]},{"title":"Tags vs Custom Events","slug":"tags-vs-custom-events","depth":3,"children":[]}]},{"title":"Quick reference","slug":"quick-reference","depth":2,"children":[]},{"title":"Send messages after a past event","slug":"send-messages-after-a-past-event","depth":2,"children":[]},{"title":"Send messages before a future event","slug":"send-messages-before-a-future-event","depth":2,"children":[{"title":"Example: Birthday messages","slug":"example-birthday-messages","depth":3,"children":[]}]},{"title":"FAQ","slug":"faq","depth":2,"children":[{"title":"How does the math work? (technical details)","slug":"how-does-the-math-work-technical-details","depth":3,"children":[]},{"title":"How can I test?","slug":"how-can-i-test","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/onesignal/e069c1b9f3157e14/hotjar-koala.js","/_mintlify/custom/onesignal/3e5d03885ab32f49/intercom.js","/_mintlify/custom/onesignal/dbb7af4794d1b586/munchkin-marketo.js"],"subdomain":"onesignal","siteName":"OneSignal","title":"Tags: Time Operators - OneSignal","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/docs/en/time-operators","matchLevel":0},"cn":{"href":"/docs/cn/time-operators","matchLevel":1},"ko":{"href":"/docs/ko/time-operators","matchLevel":1},"ja":{"href":"/docs/ja/time-operators","matchLevel":1},"tr":{"href":"/docs/tr/time-operators","matchLevel":1},"pt-BR":{"href":"/docs/pt-BR/time-operators","matchLevel":1},"es":{"href":"/docs/es/time-operators","matchLevel":1},"fr":{"href":"/docs/fr/time-operators","matchLevel":1}}},"lastModified":"2026-09-25T22:28:43.899Z","originalFileLocation":"docs/en/time-operators.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Automate time-based messages using Time Elapsed operators with Tags that store Unix timestamps in seconds.\">\u003cmeta data-mint-head name=\"application-name\" content=\"OneSignal\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Tags: Time Operators - OneSignal\">\u003cmeta data-mint-head property=\"og:description\" content=\"Automate time-based messages using Time Elapsed operators with Tags that store Unix timestamps in seconds.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"OneSignal\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://documentation.onesignal.com/docs/en/time-operators\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://onesignal.mintlify.app/_mintlify/api/og/v2?division=Tags\u0026amp;title=Tags%3A+Time+Operators\u0026amp;description=Automate+time-based+messages+using+Time+Elapsed+operators+with+Tags+that+store+Unix+timestamps+in+seconds.\u0026amp;theme=8d648f04f85028b307bd669b\u0026amp;signature=18fc59af7c7f9ed976c8be00b02b6aa00e8cb800c2ae6dae76d73fbd3f466d16\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Tags: Time Operators - OneSignal\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Automate time-based messages using Time Elapsed operators with Tags that store Unix timestamps in seconds.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://onesignal.mintlify.app/_mintlify/api/og/v2?division=Tags\u0026amp;title=Tags%3A+Time+Operators\u0026amp;description=Automate+time-based+messages+using+Time+Elapsed+operators+with+Tags+that+store+Unix+timestamps+in+seconds.\u0026amp;theme=8d648f04f85028b307bd669b\u0026amp;signature=18fc59af7c7f9ed976c8be00b02b6aa00e8cb800c2ae6dae76d73fbd3f466d16\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/onesignal/eCiRydtW5fLfLRWp/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"OneSignal Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3A3DB3\">\u003clink data-mint-head rel=\"canonical\" href=\"https://documentation.onesignal.com/docs/en/time-operators\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/en/time-operators.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://documentation.onesignal.com/docs/en/time-operators\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://documentation.onesignal.com/docs/cn/time-operators\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://documentation.onesignal.com/docs/ko/time-operators\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://documentation.onesignal.com/docs/ja/time-operators\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"tr\" href=\"https://documentation.onesignal.com/docs/tr/time-operators\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt-BR\" href=\"https://documentation.onesignal.com/docs/pt-BR/time-operators\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://documentation.onesignal.com/docs/es/time-operators\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://documentation.onesignal.com/docs/fr/time-operators\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://documentation.onesignal.com/docs/en/time-operators\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://documentation.onesignal.com/#organization\",\"name\":\"OneSignal\",\"url\":\"https://documentation.onesignal.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/onesignal/yJcueeDCO7UpHnnY/logo/OneSignal-Logo.svg?fit=max\u0026auto=format\u0026n=yJcueeDCO7UpHnnY\u0026q=85\u0026s=1fcfb6fef6d820fd9d99c74850711107\"}},{\"@type\":\"WebSite\",\"@id\":\"https://documentation.onesignal.com#website\",\"name\":\"OneSignal\",\"url\":\"https://documentation.onesignal.com\",\"publisher\":{\"@id\":\"https://documentation.onesignal.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://documentation.onesignal.com/docs/en/time-operators#webpage\",\"url\":\"https://documentation.onesignal.com/docs/en/time-operators\",\"name\":\"Tags: Time Operators\",\"description\":\"Automate time-based messages using Time Elapsed operators with Tags that store Unix timestamps in seconds.\",\"dateModified\":\"2026-09-25T22:28:43.899Z\",\"isPartOf\":{\"@id\":\"https://documentation.onesignal.com#website\"},\"breadcrumb\":{\"@id\":\"https://documentation.onesignal.com/docs/en/time-operators#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://documentation.onesignal.com/docs/en/time-operators#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Audience \u0026 events\",\"item\":\"https://documentation.onesignal.com/docs/en/segmentation\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tags\",\"item\":\"https://documentation.onesignal.com/docs/en/add-user-data-tags\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Tags: Time Operators\",\"item\":\"https://documentation.onesignal.com/docs/en/time-operators\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://documentation.onesignal.com/docs/en/time-operators#article\",\"headline\":\"Tags: Time Operators\",\"name\":\"Tags: Time Operators\",\"description\":\"Automate time-based messages using Time Elapsed operators with Tags that store Unix timestamps in seconds.\",\"url\":\"https://documentation.onesignal.com/docs/en/time-operators\",\"mainEntityOfPage\":{\"@id\":\"https://documentation.onesignal.com/docs/en/time-operators#webpage\"},\"dateModified\":\"2026-09-25T22:28:43.899Z\",\"keywords\":\"time operators, time elapsed, unix timestamp, birthday, Time Elapsed Greater Than, Time Elapsed Less Than, cart_updated_at, subscription_expires_at, send message after event, send message before date, renewal reminder, relative time targeting, timestamp in seconds not milliseconds, milliseconds vs seconds, 13 digits vs 10 digits, negative value for future date, moving time window, 24-48 hour window, users stay in segment forever, segment re-entry 52 weeks, time elapsed formula\",\"publisher\":{\"@id\":\"https://documentation.onesignal.com/#organization\"},\"isPartOf\":{\"@id\":\"https://documentation.onesignal.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"OneSignal\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"OneSignal","nav":{"global":null,"languages":[{"language":"en","tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/docs/en/home"}]},{"tab":"User Guides","groups":[{"group":"First steps \u0026 settings","pages":[{"title":"Getting started with OneSignal","href":"/docs/en/quickstart-guide"},{"group":"OneSignal dashboard","pages":[{"title":"Apps, Organizations, \u0026 Accounts","href":"/docs/en/apps-organizations"},{"title":"Team members","href":"/docs/en/manage-team-members"},{"title":"Keys \u0026 IDs","href":"/docs/en/keys-and-ids"},{"title":"Audit logs","href":"/docs/en/audit-logs"},{"title":"Usage \u0026 billing","href":"/docs/en/billing-faq"},{"title":"Disabled apps \u0026 organizations","href":"/docs/en/disabled-apps"}]},{"title":"Migrating to OneSignal","href":"/docs/en/migrating-to-onesignal"}]},{"group":"Message channels","pages":[{"title":"Channel setup","href":"/docs/en/channel-setup"},{"group":"Push","pages":[{"title":"Push overview","href":"/docs/en/push"},{"group":"Mobile push","pages":[{"title":"Mobile push setup","href":"/docs/en/mobile-push-setup"},{"title":"Prompt for push permissions","href":"/docs/en/prompt-for-push-permissions"},{"title":"iOS provisional push notifications","href":"/docs/en/ios-provisional-push-notifications"},{"title":"Android notification categories","href":"/docs/en/android-notification-categories"},{"title":"Data \u0026 background notifications","href":"/docs/en/data-notifications"},{"title":"VoIP push notifications","href":"/docs/en/voip-notifications"}]},{"group":"Web push","pages":[{"title":"Web push setup","href":"/docs/en/web-push-setup"},{"title":"Web permission prompts","href":"/docs/en/permission-requests"},{"title":"Web push FAQ","href":"/docs/en/web-push-setup-faq"},{"title":"Web push browser behavior","href":"/docs/en/browser-behavior-and-unsubscribes"},{"title":"OneSignal WordPress plugin setup for web push","href":"/docs/en/wordpress"},{"title":"WordPress troubleshooting","href":"/docs/en/troubleshooting-wordpress-web-push"},{"title":"Shopify web push integration","href":"/docs/en/shopify"}]},{"group":"Push features","pages":[{"title":"Notification icons","href":"/docs/en/notification-icons"},{"title":"Notification images \u0026 rich media","href":"/docs/en/rich-media"},{"title":"Notification sounds","href":"/docs/en/notification-sounds"},{"title":"Notification badges","href":"/docs/en/badges"},{"title":"Action buttons for push notifications","href":"/docs/en/action-buttons"},{"title":"Push frequency capping","href":"/docs/en/frequency-capping"},{"title":"Push throttling","href":"/docs/en/throttling"},{"title":"iOS: Focus modes and interruption levels","href":"/docs/en/ios-focus-modes-and-interruption-levels"},{"title":"iOS: Relevance score","href":"/docs/en/ios-relevance-score"}]},{"group":"Push analytics \u0026 troubleshooting","pages":[{"title":"Push message reports","href":"/docs/en/push-notification-message-reports"},{"title":"Confirmed receipt","href":"/docs/en/confirmed-delivery"},{"title":"Notification click-through rate (CTR)","href":"/docs/en/notification-ctr"},{"title":"Mobile push: Notifications not shown or delayed","href":"/docs/en/notifications-show-successful-but-are-not-being-shown"},{"title":"Web push: Notifications not shown","href":"/docs/en/notifications-not-shown-web-push"},{"title":"Notification Images Not Showing","href":"/docs/en/notification-images-not-showing"},{"title":"Duplicated notifications","href":"/docs/en/duplicated-notifications"},{"title":"FCM expired token FAQ","href":"/docs/en/fcm-expired-token-faq"}]}]},{"group":"In-app messages","pages":[{"title":"In-app overview","href":"/docs/en/in-app-messages-setup"},{"title":"In-app triggers","href":"/docs/en/iam-triggers"},{"title":"In-app click actions","href":"/docs/en/iam-click-actions"},{"group":"In-app design","pages":[{"title":"Design in-app messages with drag-and-drop","href":"/docs/en/design-your-in-app-message"},{"title":"Design in-app messages with HTML","href":"/docs/en/design-your-in-app-message-with-html"},{"title":"In-app message templates \u0026 quickstarts","href":"/docs/en/in-app-html-templates"},{"title":"In-app message JavaScript API reference","href":"/docs/en/in-app-message-api"}]},{"title":"In-app message reports","href":"/docs/en/in-app-message-reports"},{"title":"In-app troubleshooting","href":"/docs/en/in-app-message-troubleshooting"}]},{"group":"Email","pages":[{"title":"Email overview","href":"/docs/en/email-messaging"},{"group":"Email setup","pages":[{"title":"Email setup","href":"/docs/en/email-setup"},{"title":"Email DNS configuration","href":"/docs/en/email-dns-configuration"},{"title":"Senders","href":"/docs/en/senders"},{"title":"BCC emails","href":"/docs/en/email-bcc"},{"title":"Transactional emails","href":"/docs/en/setup-transactional-emails"},{"title":"Create a custom email unsubscribe page","href":"/docs/en/create-custom-unsubscribe-page"}]},{"group":"Email deliverability \u0026 analytics","pages":[{"title":"Email message reports","href":"/docs/en/email-message-reports"},{"title":"Email deliverability","href":"/docs/en/email-deliverability"},{"title":"Deliverability insights by inbox provider","href":"/docs/en/email-deliverability-insights"},{"title":"Email reputation best practices","href":"/docs/en/email-reputation-best-practices"},{"title":"Email address validation","href":"/docs/en/email-address-validation"},{"title":"Email warm-up","href":"/docs/en/email-warm-up"},{"title":"Google Postmaster Tools","href":"/docs/en/google-postmaster-tools"},{"title":"Suppressions","href":"/docs/en/suppressions"},{"title":"Email troubleshooting","href":"/docs/en/email-troubleshooting"}]},{"group":"Design your emails","pages":[{"title":"Design emails with drag-and-drop","href":"/docs/en/design-emails-with-drag-and-drop"},{"title":"Design emails with HTML","href":"/docs/en/design-emails-with-html"},{"title":"Email unsubscribe links \u0026 headers","href":"/docs/en/unsubscribe-links-email-subscriptions"},{"title":"Email template forwarding","href":"/docs/en/email-template-forwarding"}]}]},{"group":"SMS \u0026 RCS","pages":[{"title":"SMS, MMS, and RCS overview","href":"/docs/en/sms-messaging"},{"title":"Rich Communication Services (RCS)","href":"/docs/en/rcs-messaging"},{"group":"SMS setup","pages":[{"title":"SMS setup","href":"/docs/en/sms-setup"},{"title":"Sender resource applications and country requirements","sidebarTitle":"Sender resource applications","href":"/docs/en/sms-registration-requirements"},{"title":"SMS opt-in and collection","href":"/docs/en/sms-opt-in-and-collection"},{"title":"SMS consent keyword management","href":"/docs/en/sms-consent-keyword-management"},{"title":"SMS keywords","href":"/docs/en/keywords"}]},{"group":"SMS messaging","pages":[{"title":"Promotional messaging","href":"/docs/en/sms-promotional-messaging"},{"title":"Transactional messaging","href":"/docs/en/sms-transactional-messaging"},{"title":"One-time passwords (OTP)","sidebarTitle":"One-time passwords","href":"/docs/en/sms-verify"},{"title":"Composing messages","href":"/docs/en/sms-composing-messages"},{"title":"SMS message reports","href":"/docs/en/sms-message-reports"}]}]},{"group":"Live Activities","pages":[{"title":"Live Activities","href":"/docs/en/live-activities"},{"title":"Live Activities analytics","href":"/docs/en/live-activities-analytics"}]},{"group":"Features","pages":[{"title":"A/B testing","href":"/docs/en/ab-testing"},{"title":"Multi-language messaging","href":"/docs/en/multi-language-messaging"},{"title":"Brand Kit","href":"/docs/en/brand-kit"},{"group":"Personalization","pages":[{"title":"Personalization","href":"/docs/en/message-personalization"},{"title":"Using Liquid syntax","href":"/docs/en/using-liquid-syntax"},{"title":"Data feeds","href":"/docs/en/data-feeds"},{"title":"Personalize with Custom Events","href":"/docs/en/personalization-custom-event"},{"title":"Personalize with properties","href":"/docs/en/personalization-properties-and-tags"},{"title":"Personalize messages with API custom_data","href":"/docs/en/personalization-api-custom-data"},{"title":"Dynamic Content with CSV","href":"/docs/en/dynamic-content"}]},{"group":"URLs, Links, \u0026 Deep Links","pages":[{"title":"URLs, links, \u0026 deep links","href":"/docs/en/links"},{"title":"Deep linking","href":"/docs/en/deep-linking"},{"title":"Email unsubscribe links \u0026 headers","href":"/docs/en/unsubscribe-links-email-subscriptions"}]},{"title":"Retargeting messages","href":"/docs/en/retargeting"},{"title":"Templates","href":"/docs/en/templates"},{"title":"Labels","href":"/docs/en/labels"}]}]},{"group":"Journeys","pages":[{"title":"Journeys overview","href":"/docs/en/journeys-overview"},{"group":"Journey features","pages":[{"title":"Journey settings","href":"/docs/en/journeys-settings"},{"title":"Journey messages","href":"/docs/en/journeys-messages"},{"title":"Journey message A/B testing","sidebarTitle":"A/B testing","tag":"BETA","href":"/docs/en/journeys-ab-testing"},{"title":"Journey actions","href":"/docs/en/journeys-actions"},{"title":"Journey webhooks","href":"/docs/en/journeys-webhook"},{"title":"Send WhatsApp Messages via Journey Webhooks","href":"/docs/en/sending-whatsapp-messages-via-journey-webhooks"},{"title":"Managing journeys","href":"/docs/en/managing-journeys"},{"title":"Journey version history","tag":"NEW","href":"/docs/en/journeys-version-history"},{"title":"Journey analytics","href":"/docs/en/journeys-analytics"}]},{"title":"Journey examples","href":"/docs/en/journeys-examples"},{"title":"Control Journey membership with tags","href":"/docs/en/journeys-membership-tags"}]},{"group":"OneSignal AI","pages":[{"title":"OneSignal AI","tag":"BETA","href":"/docs/en/onesignal-ai"},{"title":"OneSignal AI skills","sidebarTitle":"Skills","tag":"BETA","href":"/docs/en/onesignal-ai-skills"},{"title":"OneSignal Home","href":"/docs/en/onesignal-home"},{"title":"OneSignal MCP Server","href":"/docs/en/model-context-protocol"},{"title":"OneSignal AI data practices","mode":"frame","href":"/docs/en/ai-data-practices"},{"title":"AI message composer","href":"/docs/en/ai-message-composer"},{"title":"OneSignal Slack Agent","hidden":true,"tag":"BETA","href":"/docs/en/slack-agent"}]},{"group":"Audience \u0026 events","pages":[{"title":"Segments","href":"/docs/en/segmentation"},{"title":"User-based segmentation","tag":"BETA","href":"/docs/en/user-based-segmentation"},{"group":"Users \u0026 Subscriptions","pages":[{"title":"Users","href":"/docs/en/users"},{"title":"Subscriptions","href":"/docs/en/subscriptions"},{"title":"Sessions","href":"/docs/en/sessions"},{"title":"User and Subscription Profiles","href":"/docs/en/user-subscription-profiles"},{"title":"Aliases","href":"/docs/en/aliases"},{"title":"Test users","href":"/docs/en/test-users"},{"title":"Delete users","href":"/docs/en/delete-users"}]},{"group":"Events","pages":[{"title":"Message events","href":"/docs/en/message-events"},{"title":"Session events","href":"/docs/en/session-events"},{"group":"Custom events","pages":[{"title":"Custom events","href":"/docs/en/custom-events"},{"title":"Custom event best practices","href":"/docs/en/custom-event-best-practices"},{"title":"Custom event storage and retention","href":"/docs/en/custom-event-storage"}]}]},{"group":"Tags","pages":[{"title":"Tags","description":"Use OneSignal Tags to store user properties and track events for advanced segmentation and personalized messaging.","href":"/docs/en/add-user-data-tags"},{"title":"Tags: Time Operators","href":"/docs/en/time-operators"}]},{"title":"Import","description":"Import or update users in OneSignal using CSV uploads, REST API, or manual entry. Supports email, SMS, tags, and more for seamless user onboarding or migration.","href":"/docs/en/import"}]},{"group":"Analytics \u0026 Integrations","pages":[{"group":"Analytics","pages":[{"title":"Analytics overview","href":"/docs/en/analytics-overview"},{"title":"Metrics glossary","href":"/docs/en/analytics-metrics-glossary"},{"title":"Goals","sidebarTitle":"Goals","tag":"BETA","href":"/docs/en/goals"},{"title":"Exporting data","href":"/docs/en/exporting-data"},{"title":"Template analytics","href":"/docs/en/template-analytics"},{"title":"Conversion metrics","href":"/docs/en/conversion-metrics"},{"title":"Engagement trends","href":"/docs/en/engagement-analytics"},{"title":"Subscription trends","href":"/docs/en/subscription-trends"},{"title":"Sessions volume","href":"/docs/en/sessions-volume"},{"group":"Retention metrics","pages":[{"title":"Retention metrics","href":"/docs/en/retention-metrics"},{"title":"Interpreting retention curves","href":"/docs/en/interpreting-retention-curves"}]},{"title":"Custom Outcomes","href":"/docs/en/custom-outcomes"}]},{"group":"Event Streams","pages":[{"title":"Event Streams","href":"/docs/en/event-streams"},{"title":"Event Stream data reference","sidebarTitle":"Event Stream data","href":"/docs/en/event-streams-data"},{"title":"In-app message event streams","href":"/docs/en/iam-event-streams"},{"title":"Google Sheets integration with Event Streams","href":"/docs/en/google-sheets-integration-with-event-streams"}]},{"group":"Integrations","pages":[{"title":"Integrations overview","href":"/docs/en/integrations"},{"title":"Data warehouse, DMP, \u0026 CRM integration","href":"/docs/en/database-dmp-crm-integration"},{"group":"OneSignal as data source","pages":[{"title":"Amplitude","href":"/docs/en/amplitude"},{"title":"Databricks","href":"/docs/en/databricks"},{"title":"Google BigQuery","href":"/docs/en/bigquery"},{"title":"Mixpanel","href":"/docs/en/mixpanel"},{"title":"Snowflake","href":"/docs/en/snowflake"},{"title":"Segment (Twilio)","href":"/docs/en/segment-onesignal-integration"}]},{"group":"OneSignal as destination","pages":[{"title":"Adobe Audience Manager","href":"/docs/en/adobe-audience-manager"},{"title":"AlloyDB","href":"/docs/en/alloydb"},{"title":"Amazon Athena","href":"/docs/en/amazon-athena"},{"title":"Amazon S3","href":"/docs/en/s3"},{"title":"Amplitude","href":"/docs/en/amplitude"},{"title":"Apache Kafka","href":"/docs/en/kafka"},{"title":"Amazon Redshift","href":"/docs/en/amazon-redshift"},{"title":"Azure Synapse","href":"/docs/en/azure-synapse"},{"title":"ClickHouse","href":"/docs/en/clickhouse"},{"title":"Confluent Cloud","href":"/docs/en/confluent-cloud"},{"title":"Databricks","href":"/docs/en/databricks"},{"title":"Elasticsearch","href":"/docs/en/elasticsearch"},{"title":"Google BigQuery","href":"/docs/en/bigquery"},{"title":"Google Cloud SQL","href":"/docs/en/google-cloud-sql"},{"title":"Google Sheets","href":"/docs/en/google-sheets"},{"title":"Greenplum","href":"/docs/en/greenplum"},{"title":"HubSpot","href":"/docs/en/hubspot"},{"title":"Materialize","href":"/docs/en/materialize"},{"title":"Microsoft Fabric","href":"/docs/en/microsoft-fabric"},{"title":"Mixpanel","href":"/docs/en/mixpanel"},{"title":"MotherDuck","href":"/docs/en/motherduck"},{"title":"MySQL","href":"/docs/en/mysql"},{"title":"PostgreSQL","href":"/docs/en/postgresql"},{"title":"Pub/Sub","href":"/docs/en/google-pubsub"},{"title":"SingleStore","href":"/docs/en/singlestore"},{"title":"Snowflake","href":"/docs/en/snowflake"},{"title":"SQL Server","href":"/docs/en/sql-server"},{"title":"Starburst Enterprise","href":"/docs/en/starburst-enterprise"},{"title":"Starburst Galaxy","href":"/docs/en/starburst-galaxy"},{"title":"Trino","href":"/docs/en/trino"},{"title":"Segment (Twilio)","href":"/docs/en/segment-onesignal-integration"}]},{"group":"Attribution","pages":[{"title":"RevenueCat","href":"/docs/en/revenuecat"},{"title":"Adjust","href":"/docs/en/adjust"},{"title":"BlueConic","href":"/docs/en/blueconic"}]},{"title":"Building an integration with OneSignal: partner guide","href":"/docs/en/building-an-integration-with-onesignal-partner-guide"}]}]},{"group":"Privacy \u0026 Security","pages":[{"group":"Security credentials","pages":[{"title":"SOC 2 Type II","href":"/docs/en/soc-2-type-ii"},{"title":"ISO 27001","href":"/docs/en/iso27001"},{"title":"HIPAA","href":"/docs/en/hipaa"}]},{"group":"Data privacy \u0026 regulatory compliance","pages":[{"title":"GDPR \u0026 Individual Rights","href":"/docs/en/gdpr-compliance"},{"title":"EU-US Data Privacy Framework","href":"/docs/en/eu-us-data-privacy-framework"},{"title":"Email regulatory compliance","href":"/docs/en/email-compliance"},{"title":"SMS regulatory compliance","href":"/docs/en/sms-regulatory-compliance"},{"title":"Apple App Privacy Requirements","href":"/docs/en/apple-app-privacy-requirements"},{"title":"Google Play Data Safety Requirements","href":"/docs/en/google-play-data-safety-requirements"},{"title":"Data collection \u0026 security FAQs","href":"/docs/en/data-questions"},{"title":"Data collected by the OneSignal SDK","href":"/docs/en/data-collected-by-the-onesignal-sdk"},{"title":"Handling personal data","href":"/docs/en/handling-personal-data"},{"title":"Data taxonomy","href":"/docs/en/data-taxonomy"},{"title":"OneSignal AI data practices","mode":"frame","href":"/docs/en/ai-data-practices"}]},{"group":"Authentication","pages":[{"title":"2-step authentication","href":"/docs/en/2-step-authentication"},{"title":"Single Sign-On (SSO)","href":"/docs/en/sso"}]}]}]},{"tab":"Developer Guides","pages":[{"title":"Developer Guides","href":"/docs/en/developers"}]},{"tab":"Tutorials","pages":[{"title":"Tutorials","href":"/docs/en/tutorials"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/reference/rest-api-overview"}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/changelog"}]},{"tab":"Customer Success Hub","pages":[{"title":"Customer Success Hub","href":"/docs/en/customer-success-hub"}]}],"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://onesignal.com/blog"},{"anchor":"GitHub","icon":"github","href":"https://github.com/OneSignal"},{"anchor":"YouTube","icon":"youtube","href":"https://www.youtube.com/@onesignalofficial/playlists"}]}},{"language":"cn","pages":[{"title":"cn","href":"/docs/cn/time-operators"}]},{"language":"ko","pages":[{"title":"ko","href":"/docs/ko/time-operators"}]},{"language":"ja","pages":[{"title":"ja","href":"/docs/ja/time-operators"}]},{"language":"tr","pages":[{"title":"tr","href":"/docs/tr/time-operators"}]},{"language":"pt-BR","pages":[{"title":"pt-BR","href":"/docs/pt-BR/time-operators"}]},{"language":"es","pages":[{"title":"es","href":"/docs/es/time-operators"}]},{"language":"fr","pages":[{"title":"fr","href":"/docs/fr/time-operators"}]}]},"title":"Tags: Time Operators - OneSignal","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-DYplxqhs.js","DynamicMarkdown-Cc6AuSHS.js","zoom-image-lightbox-BNnMwe0F.js","lightbox-handle-r17bVUz3.js"]}