On Mon, 14 Jun 2021 at 21:57, Adam Hooper <a...@adamhooper.com> wrote:
>
> On Mon, Jun 14, 2021 at 3:25 PM Weston Pace <weston.p...@gmail.com> wrote:
>
> > > So it's wrong to put "timezone=UTC", because in Arrow, the 'timezone"
> > field
> > > means, "how the data is *displayed*." The data isn't displayed as UTC.
> >
> > I don't think users will generally be using Arrow to format timestamps
> > for display to the user.
>
>
> Well, I didn't want to open *this* can of worms, but:
>
> If the timezone field doesn't say how to display data to the user, and we
> agree it doesn't describe how data is stored (since its very presence means
> data is stored as UTC) ... well ... what *is* the meaning of the timezone
> field?
>
> (In my opinion, there shouldn't be a field at all.)
>

How data is eventually displayed to the user, is up to the
*application* I think. Yes, the spec speaks about how the data is
displayed, but for me this is only about raw Arrow data and to help
explain the interpretation. IMO it's totally fine that an application
decides to display UTC timestamps in the user's locale time zone.

So if you have an application where you want to display the timestamp
in the user's system time zone, then you can use "timestamp with time
zone" with tz=UTC to store all timestamps as UTC, and display them
using the system locale.

But this timezone field is still useful for other applications that
*don't* want to display the timestamps in the user's system time zone.
One example of such an application is the pandas library, where we
want to enable that users can store timezone-aware timestamps (so
unambiguous points on the time-line, in contrast to tz-naive
timestamps without timezone), while still being able to express the
"local" time zone of the data / study (and store this in the data), so
that queries like "Give me all events that happened on Tuesday"
(example from Weston's answer) or "all events that happened between 8
and 9am" still work (and ensuring that such queries give the same
result wherever on the world you run the script analysing the
dataset).

Reply via email to