Apexcharts time not matching JavaScript/Python

Viewed 1974

In my Python

  2020-09-23T10:50:46.838023 

In JavaScript

  2020-09-23T10:50:46.838023

In JavaScript apexcharts format

  2020-09-23T03:50:46.838023

why has it changed the hour from 10 to 03?

This my Vue code

chartOptions: {
              chart: {
                id: "chart" + key,
                type: obj.chart,
                zoom: {
                  enabled: false,
                },
              },
              tooltip: {
                x: {
                  format: 'dd/MMM HH:mm:ss',
                }
              },
              xaxis: {
                type: "datetime",
                categories: obj.time,
                labels: {
                  show: true
                }
              },
            },
          };

My obj is object used for foreach loop.

1 Answers

If you want to display local time in ApexCharts, turn off the UTC flag on x-axis labels.

xaxis: {
  labels: {
    datetimeUTC: false
  }
}
Related