Time zones - hours
In data, the timestamps may be provided in a time zone that differs from UTC. Use 'timeZone' to ensure they are displayed properly.
- The expected values: 20:00 = 1; 21:00 = 2; 02:00 = 3; 03:00 = 4
HTML
                        HTML
                            
                        
                        
                <script src="https://cdn.zoomcharts-cloud.com/1/nightly/zoomcharts.js"></script>
<ul>
    <li>The expected values: 20:00 = 1; 21:00 = 2; 02:00 = 3; 03:00 = 4</li>
</ul>
<div id="demo"></div>
CSS
                        CSS
                            
                        
                        
                //No CSS for this example 
JavaScript
                        JavaScript
                            
                        
                        
                
var t = new TimeChart(
    {
        container: document.getElementById("demo"),
        data:
        {
            units:["h"],
            preloaded: {
                unit: "h",
                values: [
                    ["2015-06-01 20:00:00", 1],
                    ["2015-06-01 21:00:00", 2],
                    ["2015-06-02 02:00:00", 3],
                    // although the date is 2015-06-03, the timestamp is first adjusted to Europe/Riga
                    // so it is read as "2015-06-02T03:00:00+03:00".
                    ["2015-06-02 00:00:00+00:00", 4],
                ],
                
                dataLimitFrom: "2015-06-01",
                dataLimitTo: "2015-06-03",
                // the default timezone if the offset is not specified with the timestamp
                timeZone: "Europe/Riga"
            },
        },
        timeAxis: {
            //timeZone: "America/New_York"
            //timeZone: "UTC"
            timeZone: "Europe/Riga"
        }
    }
);
Data
                        Data
                            
                        
                        
                    
            
                    
                //No separate data for this example