Javascript - 设置脚本实例的时区
在图表中,根据查看者的时区设置,点可能会也可能不会落在垂直网格条上。实际上,只有当本地时区设置为 utc 时,日期栏上才会显示这些点。这确实有意义,因为样本引用的时间在所有时区都不是相同的时钟时间。
但是,对于应用程序,我想关闭此行为并显示相同的图表,无论本地计算机的时区是什么。
为此,我想我可能能够以某种方式将脚本的时区设置为 UTC(不更改 Windows 中的设置)。这可能吗?
In a flot graph depending on the viewers timezone setting the points may or may not fall on vertical grid bars. Actually, only when the local timezone is set to utc the points are on the date bars. This does make sense as the time the sample refers to is not the same clock-time in all timezones.
However, for an application I want to turn this behavior off and display the same graph whatever the local machine's timezone is.
For that I thought I might be somehow able to set the timezone for the script to UTC (not changing the setting in Windows. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

API 文档可能会有所帮助,请向下滚动到“时间序列数据”部分。我认为这可能会帮助您解决您的问题:
http://people.iola.dk /olau/flot/API.txt
The API documentation may be of help, scroll down to the section "Time series data". I think that this may help you to solve your problem:
http://people.iola.dk/olau/flot/API.txt