4 <link rel=
"stylesheet" href=
"../css/dygraph.css">
5 <title>UTC date labels
</title>
7 For production (minified) code, use:
8 <script type=
"text/javascript" src=
"dygraph-combined.js"></script>
10 <script type=
"text/javascript" src=
"../dist/dygraph.js"></script>
14 <h2>UTC date and time labels
</h2>
16 <p>This shows how date ticks and labels may be generated according to local
17 time (default) or UTC with the option
<code>labelsUTC
</code>.
</p>
19 <p>72 hours of random hourly data since
2009-Jul-
23 18:
00 UTC
20 according to local time (top) and UTC (bottom):
</p>
22 <div id=
"div_loc" style=
"width:600px; height:200px;"></div>
23 <div id=
"div_utc" style=
"width:600px; height:200px;"></div>
25 <p>Please note the offset between the respective ticks in both plots.
26 It should match your local time zone offset.
</p>
28 <p>You can also check it by hovering over corresponding points and comparing
31 <p>Try different zoom levels to show that ticks are always placed at nice
34 <script type=
"text/javascript">
35 var data = (function() {
36 var rand10 = function () { return Math.round(
10 * Math.random()); };
38 for (var y =
2009, m =
6, d =
23, hh =
18, n=
0; n <
72; n++) {
39 a.push([new Date(Date.UTC(y, m, d, hh + n,
0,
0)), rand10()]);
44 document.getElementById(
"div_loc"),
47 labels: ['local time', 'random']
51 document.getElementById(
"div_utc"),
55 labels: ['UTC', 'random']