d3js Dateformat: Hours, Minutes and Seconds incorrect

i have chart made with d3js( V7 ). It displays the Date correct but not the time.

I get “2023-02-01 01:00:00” for new Date(‘2023-02-01 09:00:00’).

My Dateformat:
d3.axisBottom( d3.scaleUtc().domain([this.minXValue, this.maxXValue]).range([this.currentElementOptions.margin.left, this.xAxisWidth]) ).tickFormat(d3.timeFormat('%Y-%m-%d %H:%M:%S'));

I should get “2023-02-01 09:00:00” and not “2023-02-01 01:00:00”

What am i doing wrong/missing?

The timezone should not matter.

1 Like

According to the MDN Docs on Date the timezone does matter. Perhaps, you should use d3.utcFormat, rather than d3.timeFormat.