Is local! the intended mechanism for local-time D3 formatting? #43551
Replies: 1 comment
|
Hi @gianfranco-campana-vs! I'm Dosu and I'm helping the Apache Superset team. Your analysis is exactly correct, and It's an established, deliberate feature.
Why it's not exposed in the Table Chart UI. The Table Chart calls Practical bottom line. You can use If you'd like to see this improved, a documentation update explaining the To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Uh oh!
There was an error while loading. Please reload this page.
I'm investigating timezone formatting in Apache Superset and would like to clarify the intended behavior of the D3 time formatter.
Superset officially uses UTC for timestamp handling, which I understand and am not questioning.
However, while investigating the frontend formatter used by the Table Chart, I found that Superset has an explicit mechanism to switch between UTC and local-time formatting.
For a temporal column, using this D3 format:
the Table Chart formats the timestamp in UTC.
Using:
the same timestamp is formatted using the browser/local timezone.
For example, with Europe/Rome during CEST:
I traced this behavior through the frontend code.
The relevant formatter logic recognizes the
local!prefix and converts it intouseLocalTime: true. The formatter construction then uses local formatting whenuseLocalTimeis true and UTC formatting otherwise.In other words, the code path appears to be explicitly designed to distinguish:
and
local!is the mechanism used by the formatter to request the latter.What I cannot determine is the intended user-facing status of this mechanism.
In the Table Chart UI, the "D3 format" selector provides predefined formats such as:
but there is no indication that prefixing a format with
local!changes the timezone behavior.For example, there is no visible option such as:
I also could not find documentation explaining the
local!prefix or how users are expected to request local-time D3 formatting.This is particularly important for BI dashboards used in organizations operating outside UTC.
For users working in a local timezone, timestamps displayed in dashboards are not merely a formatting preference: they are part of the meaning of the data. A timestamp displayed two hours earlier or later can affect how users interpret events, sequences, durations, operational activity, and ultimately the business decisions based on the dashboard.
Therefore, the ability to explicitly request local-time rendering is an important aspect of making timestamp visualization usable in real-world BI scenarios, even when UTC remains the canonical timezone used internally by Superset.
My question is therefore:
Is
local!the intended and supported mechanism for displaying D3-formatted timestamps in the user's local timezone?If yes, is there a reason why this mechanism is not documented and/or exposed in the D3 format choices of the Table Chart?
I am particularly interested in understanding whether this is an established Superset feature, an undocumented feature, or functionality that is still under development.
I can provide the relevant frontend code path and a more detailed description of the debugging process if useful.
All reactions