Timezone Handling in Databricks Tables
Insights stores all event timestamps in the server timezone (IST / Asia/Kolkata), regardless of the store or region where the event originated. This applies consistently across all fact tables in Databricks, such as transactions, points awards, redemptions, slab upgrades, and more.
Key concepts
Time dimension keys
Each event in a fact table is associated with two time-based dimension keys that power all time-based analysis. For example, daily trend reports, time-of-day breakdowns, and chronological sequencing of customer journeys.
| Field | What it represents |
|---|---|
dim_event_date_id | Date of the event in YYYYMMDD format (e.g., 20240611 for 11 June 2024) |
dim_event_time_id | Minute of the day when the event occurred (e.g., 478 = 7:58 AM, 808 = 13:28) |
Both fields always reflect server time (IST), making cross-store and cross-region comparisons reliable.
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 for that event is resolved by starting at the till level and working upward through the store hierarchy 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 | Org-level default timezone, used as the final fallback |
This means every till in Insights always resolves to a valid timezone. If a till has no timezone configured, it inherits 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: Cross-region transaction sequence
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 ✓ |
Both events are correctly ordered and reflect the true 3-hour gap between them.
Availability and configuration
Timezone handling in Insights is config-driven and not enabled by default. It must be turned on per organisation using two configurations.
Organisation-level feature flag
| 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 new data only. 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. 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 the 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 19 days ago
