Line chart time plot in Dashboard2

Hi,

I have another question about time plotting on Dashbord2 line chart.

In mysql table has UTC timestamp and add local time column with query below. When give this data set to chart, different time scale showed up as below. The UTC is 13:00 and local_time is 0:00 but 10AM. Current NodeRED server location is Brisbane, 1 hour behind from Sydeny but still different from that. Is there anyway to show the local time as X axis scale?

SELECT CONVERT_TZ(DateTime, 'UTC', 'Australia/Sydney') as local_time, datetime,
    id, stuncurrent, stunvoltage 
FROM Stun_log.Stunlog1 
WHERE datetime >= CONVERT_TZ(CONCAT('2024-11-17', ' 00:00:00'), 'Australia/Sydney', 'UTC')
     AND datetime < CONVERT_TZ(CONCAT('2024-11-17'+ INTERVAL 1 DAY, ' 00:00:00') , 'Australia/Sydney', 'UTC')
 limit 4;
[
  {
    "local_time": "2024-11-17T00:00:08.000Z",
    "datetime": "2024-11-16T13:00:08.000Z",
    "id": 12336,
    "stuncurrent": 11,
    "stunvoltage": 230
  },
  {
    "local_time": "2024-11-17T00:00:18.000Z",
    "datetime": "2024-11-16T13:00:18.000Z",
    "id": 12337,
    "stuncurrent": 11,
    "stunvoltage": 240
  },
  {
    "local_time": "2024-11-17T00:00:28.000Z",
    "datetime": "2024-11-16T13:00:28.000Z",
    "id": 12338,
    "stuncurrent": 11,
    "stunvoltage": 250
  },
  {
    "local_time": "2024-11-17T00:00:38.000Z",
    "datetime": "2024-11-16T13:00:38.000Z",
    "id": 12339,
    "stuncurrent": 11,
    "stunvoltage": 260
  }
]

You should leave the timestamps in UTC, the browser should display them in the local time of the browser.

Thank you Colin,

Once changed the X axis to UTC, it shows good. So time scale will be changed if access from different timezone. It is ok for now still shows same same data set.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.