-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Showing date/times in user's local timezone? #99
Comments
I know this might seem counter-intuitive but the fix would be to remove "Data date format" (or When you remove date formatting option, the JavaScript's native parser takes over, which will parse date using correct time-zone info. However, better option would be to supply your dates in data as timestamps. |
Removing
By this do you mean it is better to supply dates in epoch time rather than in ISO8601 format? |
Sorry, your reply slipped through the cracks. Yes, this way there's no expensive string date parsing. And some older browsers will have issues in parsing string dates. The timestamp gets supplied directly to And timestamps are always in UTC. |
Cheers for the explanation. I'll have a go sometime in the near future and see if I observe any gains. |
"Removing Can you explain this in a little more detail? I am having the same issue. I am passing UTC, but when the chart shows it is always converted to the computer's timezone. I would prefer passing the data how it is, or in a timezone of my choosing even, not changing my data at all. |
My problem was the opposite to yours; I wanted to pass in UTC and display it in the client's timezone. Thus if you want to display your data as-is, you should make sure the dataDateFormat line is there, otherwise it will show up as the client's timezone: |
I have data from an API that returns datetime strings in UTC. Example dataset here
When plotting these data I want the datetimes to be shown in the user's local timezone, not UTC.
Is this possible using amcharts?
(I thought about writing a postProcess function that loops through the whole dataset and updates each datetime string to an adjusted datetime string or object, but it sounds like a kludge..)
The text was updated successfully, but these errors were encountered: