4.3.0
https://codesandbox.io/s/echarts-xaxis-time-ef3e3
I expect labels to be dates from "2019-10-01 00:00" to "2019-10-31 00:00".
Last label is "2019-10-30 23:00" instead of "2019-10-31 00:00".

Last label is "2019-10-31 00:00"
Not when I view it.

Using Chrome latest version on macos.
This may be a bug related to time-zone. @gajus Could you tell us what your time-zone is?
Eastern European Summer Time
This shouldn't say waiting-for: author anymore.
Thanks for your update. Let's see if we can get this fixed in 4.6.0.
BTW, if you're interested in making a pull request, that would be perfect because it may be easier for you to reproduce this problem. Please let us know if you need some help on this.
Eastern European Summer Time is a daylight saving time zone with which different browsers handle in different ways, e.g., the timestamp 1572469200000 in Firefox is equivalent to '2019-10-31 00:00', but in Chrome it is '2019-10-30 23:00'.
I'm not sure whether this is a bug. Hereby to let you know. @100pah
@devyumao Chrome and Firefox are the same in my computer for new Date(1572469200000),
they are both Wed Oct 30 2019 23:00:00 GMT+0200 (Eastern European Standard Time)
@gajus
By default, echarts uses local timezone to formate time labels.
But if we set timezone to Eastern European, there would be
Eastern European Summer Time issue, as @devyumao said.
The boundary of Eastern European Summer Time and Eastern European Standard Time is:
new Date(1572137999999)
Sun Oct 27 2019 03:59:59 GMT+0300 (Eastern European Summer Time)
new Date(1572137999999 + 1)
Sun Oct 27 2019 03:00:00 GMT+0200 (Eastern European Standard Time)
In your case, the time axis is from Oct 1 to Oct 31, which crosses the boundary (about Oct 27),
so the time labels look weird.
So, the option useUTC is recommended in your case:
option = {
useUTC: true,
xAxis: {...},
yAxis: {...}
series: {
...
}
}
If you are using string-formatted time in data (for example, "2019-10-01"),
we do not need to convert the time to UTC, it's OK to keep the current time data.
The useUTC just make sure all of the string time formatted in consistent way.
Closed due to not-a-bug.
Most helpful comment
@gajus
By default, echarts uses local timezone to formate time labels.
But if we set timezone to Eastern European, there would be
Eastern European Summer Timeissue, as @devyumao said.The boundary of
Eastern European Summer TimeandEastern European Standard Timeis:In your case, the time axis is from Oct 1 to Oct 31, which crosses the boundary (about Oct 27),
so the time labels look weird.
So, the option useUTC is recommended in your case:
If you are using string-formatted time in data (for example,
"2019-10-01"),we do not need to convert the time to UTC, it's OK to keep the current time data.
The
useUTCjust make sure all of the string time formatted in consistent way.