Set timezone of imported data

I’m importing data with a timestamp field provided in my local timezone. It looks like this.

04/01/2023 06:58:36,4252
04/01/2023 13:18:34,1997
04/01/2023 18:18:34,1948
04/03/2023 06:58:36,4218
04/03/2023 06:58:37,4218

When I import the data into a table, the timestamp column is rendered as an ISO format in UTC instead of my local timezone, -07:00. For example, my first timestamp is rendered as 2023-04-01T13:58:36Z.

When I bin by the hour, my hour labels are shifted 7 hours into the future. I’d like to display a histogram with the hours by local time.

  1. Is there a setting for Observable to use a timezone other than UTC for rendering?

  2. Since the shape of the histogram is correct (just shifted by 7 hours), is there some Plot magic I could use to shift the axis labels by 7 hours?

Sample: Temporal Histogram / Paul Glezen | Observable

Setting the scale’s type to time will make the scale work in the local time zone of the browser. In other words, it is consistent for readers who happen to be in the same tz as the data. Beyond this (and of course, UTC), it’s currently not possible to set a specific timezone in Plot. See issue #531.

1 Like