Timezone Handling in Databricks Tables
Insights stores all event timestamps - transactions, points awards, redemptions, slab upgrades, and more in the server timezone (IST / Asia/Kolkata). This applies consistently across all fact tables in Databricks, regardless of which store or till the event originated from.
Each event in a fact table is associated with two time-based dimension keys:
| Field | What it represents |
|---|---|
| dim_event_date_id | The date of the event, in the format YYYYMMDD (e.g. 20240611 for 11 June 2024) |
| dim_event_time_id | The minute of the day when the event occurred (e.g. 478 = 7:58 AM, 808 = 13:28) |
These keys are what power all time-based analysis such as daily trend reports, time-of-day breakdowns, and chronological sequencing of customer journeys in Databricks.
How Timezone is determined for each event
Every event in Insights is associated with a till, the point-of-sale terminal where the event was recorded. The timezone used for that event is resolved from the till's location in the store hierarchy. Insights looks up the timezone starting at the till level and works upward until a timezone is found:
| Priority | Level | Description |
|---|---|---|
| 1 | Till | Timezone configured directly on the till |
| 2 | Store | Timezone of the store the till belongs to |
| 3 – 6 | Zone (Levels 1–4) | Timezone of the zone hierarchy above the store |
| 7 | Organisation default | The org-level default timezone, used as the final fallback |
This means every till in Insights always resolves to a valid timezone. If a till does not have a timezone configured, the timezone is inherited from its parent store, then from the zone above it, and so on up to the organisation default.
What this means for your data
When an event is recorded, Insights converts the raw timestamp from the till's local timezone into the server timezone (IST) before storing the event date and time keys. This ensures that:
-
All events across stores in different geographies are recorded on a single, consistent timeline.
-
Sequential events — such as a points earn followed by a redemption always appear in the correct chronological order, even when they happen across stores in different timezones.
-
The
dim_event_date_idanddim_event_time_idvalues always reflect server time (IST), making cross-store and cross-region comparisons reliable.
Example
Scenario: A customer earns points at a store in India (IST, UTC+5:30) and redeems them 3 hours later at a store in Dubai (GST, UTC+4:00).
| Earn event | Redemption event | |
|---|---|---|
| Local time at store | 10:00 AM IST | 11:30 AM GST (= 13:00 IST) |
| Stored in Insights as (IST) | 10:00 AM | 13:00 PM |
| dim_event_time_id | 600 | 780 |
| Time gap shown in Insights | 3 hours (correct) |
Both events are correctly ordered and reflect the true 3-hour gap between them.
Availability and enabling
Timezone handling in Insights is a config-driven feature. It is not enabled by default and must be turned on per organisation. There are two configurations involved:
Organisation-Level Feature Flag
The master switch that enables timezone-aware processing for an organisation's data in Insights.
| Property | Details |
|---|---|
| Config name | ENABLE_INSIGHTS_TIMEZONE_CONVERSION |
| Default | Disabled (FALSE) |
| Scope | Per organisation |
| How to enable | Raise a request with the Capillary support team |
Important
Enabling this config applies to all new data going forward. Existing historical data in Databricks is not automatically updated. If you need historical data to reflect the corrected timezone values, a full re-sync is required. Please discuss this with your Capillary account team before enabling, especially if you sync Databricks data to an external data warehouse.
Source Column Timezone Config
Not every fact table requires timezone conversion. Only the specific tables and columns where timestamps are stored in a local timezone rather than server timezone. This is managed through a per-column configuration maintained by Capillary.
When onboarding a new data source, Capillary identifies which columns need timezone conversion and registers them in this configuration. You do not need to manage this directly.
| Property | Details |
|---|---|
| Config name | Source Column Timezone Config |
| Managed by | Capillary (as part of data source onboarding) |
| Default | Disabled for all columns unless explicitly registered |
| Scope | Per source column, applied across all orgs using that column |
Steps to Enable
| Step | Action | Owner |
|---|---|---|
| 1 | Raise a request to enable ENABLE_INSIGHTS_TIMEZONE_CONVERSION for your organisation | You/ Capillary support team |
| 2 | Confirm which fact tables and time columns are in scope | Capillary support team |
| 3 | Decide whether to trigger a full re-sync for historical data correction | You / Capillary account team |
Notes
- New organisations onboarded to Insights after this feature was introduced will have timezone handling configured from the start. A re-sync is only relevant for existing organisations enabling the feature on pre-existing data
- In future, timezone handling will be extended to additional fact tables that do not currently have
till_iddirectly available. These tables will be enriched with store and till information before timezone conversion is applied.
Updated about 3 hours ago
