0

We're using Highcharts for visualize continuous measurement data on our website.

enter image description here

As the customers sit around the world we need some proper date and time formatting to show the time and date on the x-axis in a locally common format.

What is the best way to detect which region the customer is in and is there any library or list according to ISO 8601 that can help us? (I don't want to rely on IP region detection, by the way).

Thanks.

Norbert
  • 4,239
  • 7
  • 37
  • 59
  • In modern browsers, javascript comes with locale conversion functions. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleFormat - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString – nilsole Oct 12 '16 at 13:26
  • might also be helpful: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset - http://stackoverflow.com/questions/1091372/getting-the-clients-timezone-in-javascript – nilsole Oct 12 '16 at 13:30

0 Answers0