# Change Plotly default behaviour for plotting datetimes?

**URL:** <https://community.plotly.com/t/change-plotly-default-behaviour-for-plotting-datetimes/95661>\
**Category:** plotly.js\
**Tags:** tips-and-tricks, bug-reporter\
**Created:** [November 27, 2025, 10:58am UTC](https://community.plotly.com/t/change-plotly-default-behaviour-for-plotting-datetimes/95661 "2025-11-27T10:58:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tunneller](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@Tunneller](https://community.plotly.com/u/Tunneller)\
**Post date:** [November 27, 2025, 10:58am UTC](https://community.plotly.com/t/change-plotly-default-behaviour-for-plotting-datetimes/95661/1 "2025-11-27T10:58:48Z")

</div>

This is a really old question, but bumping just in case there is an update. I want users to see the time that sensor data was collected, not the time that it happened to be in a different part of the world.

My failure was trying to pass plotly the data as milliseconds since the UTC epoch. It seems that plotly somehow finds the timezone of the browsers computer and subtracts that timezone so that, say, 1764247200000 displays as a different time depending on where the user lives.

If I convert the milliseconds to strings, however, e.g. “2025-11-27 10:00:00”, or “2025-11-27T10:00:00Z” then plotly does not subtract the timezone. I find this very odd. So is the conclusion that date format must always be strings? Or maybe a configuration setting to tell Plotly to not do the subtraction??

---

<div class="post-metadata">

**Author:** ![Tunneller](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@Tunneller](https://community.plotly.com/u/Tunneller)\
**Post date:** [November 27, 2025, 2:10pm UTC](https://community.plotly.com/t/change-plotly-default-behaviour-for-plotting-datetimes/95661/2 "2025-11-27T14:10:47Z")

</div>

What is working is to download the data from Cloud, add the sensor timezone and save that as a fake string “2025-11-27T10:00:00Z” so that the browser thinks it is in UTC time, but isnt really. That fools Date.parse (and hence Plotly) and so the data finally plots in the sensor timezone.

---

<div class="post-metadata">

**Author:** ![Kumar](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/kumar/32/34514_2.png) [@Kumar](https://community.plotly.com/u/Kumar)\
**Post date:** [August 24, 2026, 4:29pm UTC](https://community.plotly.com/t/change-plotly-default-behaviour-for-plotting-datetimes/95661/3 "2026-08-24T16:29:37Z")

</div>

With the help of this library, we can show the Plotly data in any time zone

> **[plotly-timezone](https://www.npmjs.com/package/plotly-timezone)**
>
> Feed Plotly.js a UTC timestamp and an IANA zone, get correct, fast, DST-aware display — without a per-point Intl call.. Latest version: 1.0.1, last published: 2 days ago. Start using plotly-timezone in your project by running \`npm i plotly-timezone\`....
