Page 1 of 1

How to correctly utilize the timezone option

Posted: Fri Mar 05, 2021 9:13 am
by sayed
Hi,

Long story short:
I want to show the dates in the x-axis based on my customer timzeone which is coming from the server i.e 'Asia/Calcutta' ..etc
I have set useUTC to false and provided the timezone like this:

Code: Select all

time:{
  useUTC: false,
  timezone: 'Asia/Calcutta',
},
gantt-local-timezone-2.PNG
gantt-local-timezone-2.PNG (19.19 KiB) Viewed 4890 times
Yet, I see Highchart is handling the DST transition and I can see 1 hour is missing from the x-axis because of my own time zone which is "Europe/London".

Note; There's no DST in use in 'Asia/Calcutta' timezone


Live Demo: https://jsfiddle.net/Sayed110/o2s0y64f/57/

Re: How to correctly utilize the timezone option

Posted: Fri Mar 05, 2021 9:51 am
by artakserkses
comment this line:

Code: Select all

	useUTC: false,

Re: How to correctly utilize the timezone option

Posted: Fri Mar 05, 2021 11:11 am
by sayed
artakserkses wrote: Fri Mar 05, 2021 9:51 am comment this line:

Code: Select all

	useUTC: false,
But that will start using the UTC and ignores the provided time zone.

Re: How to correctly utilize the timezone option

Posted: Fri Mar 05, 2021 12:04 pm
by artakserkses
sayed wrote: Fri Mar 05, 2021 11:11 am
artakserkses wrote: Fri Mar 05, 2021 9:51 am comment this line:

Code: Select all

	useUTC: false,
But that will start using the UTC and ignores the provided time zone.
No, timezone stays (getTime takes time in UTC, and timezone translate it to actual timezone). On your jsfiddle when you comment timezone you have chart between 2200 and 0115, and after adding timezone (without useUTC: false) you have chart between 0330 and 0645 (or something like that :) ) )

Re: How to correctly utilize the timezone option

Posted: Fri Mar 05, 2021 3:01 pm
by sayed
artakserkses wrote: Fri Mar 05, 2021 12:04 pm
No, timezone stays (getTime takes time in UTC, and timezone translate it to actual timezone). On your jsfiddle when you comment timezone you have chart between 2200 and 0115, and after adding timezone (without useUTC: false) you have chart between 0330 and 0645 (or something like that :) ) )
Thanks for your help :) . now I just need to get those dates in UTC from the server which's easy.

Re: How to correctly utilize the timezone option

Posted: Fri Mar 05, 2021 4:13 pm
by sebastian.h
Hi sayed!
That's great to hear that you found a solution.

@artakserkses thanks for your help :)

Best regards.