Time Lag


My name is Natasha. I am working on creating a visualization using Cesium that illustrates the movement of New Jersey residents during a typical day. I am starting out developing this visualization by being able to visualize one vehicle moving. I have a pre-existing data set that includes the location and time of the origination point and destination point of New Jersey residents.

I tried producing a visual of just one trip made in New Jersey before extending the visualization to thousands of trips. I came across a problem, however. For some reason, the vehicle takes 4 extra hours in completing its path than it should. When I changed the time interval of the "availability" property from the original time I used to the ending time minus 4 hours, this problem was alleviated.

Is this a bug in Cesium or is there something wrong with my code? Here is an example of the code I am using:

<!DOCTYPE html>
<html lang='en'>
<script src='Cesium/Cesium.js'></script>
@import url(Cesium/Widgets/widgets.css);
#cesiumContainer {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
margin: 0;
overflow: hidden;
padding: 0;
font-family: sans-serif;
body {
padding: 0;
margin: 0;
overflow: hidden;
<div id='cesiumContainer' class='fullSize'></div>
<div id='loadingOverlay'><h1>Loading...</h1></div>
<div id='toolbar'></div>
var builtInCzml = [{
'availability' : '2012-08-04T01:37:47Z/2012-08-04T22:11:34',
'billboard' : {
'position' : {
'interpolationAlgorithm' : 'LAGRANGE',
'interpolationDegree' : 1,
'epoch' : '2012-08-04T00:00:00Z',
'cartographicDegrees' : [5867, -74.7736068388625, 39.29797395079595, 0.0,
7894, -75.04907122590834, 39.428219971056436, 0.0]
function useBuiltInCzml() {
var czmlDataSource = new Cesium.CzmlDataSource();
var viewer = new Cesium.Viewer('cesiumContainer');

I would really appreciate any feedback on the subject!


Hi Natasha,

This is just a hunch without having studied your CZML in detail, but a four hour time difference just happens to be the difference between New Jersey’s current local time zone and UTC. Could it be just a time zone problem somewhere along the way?


That is certainly a good point. I am still confused though. Even with the time zone difference, the time interval is still supposed to be 44 minutes and not 4 hours and 44 minutes. The vehicle starts at the correct time, that is 1:37am, however, it goes till the wrong time, 6:11am rather than 2:11am. This shouldn't happen even with the difference in time zone, right?

Also, thank you for the remarkably quick response!

Your CZML specifies this availability:

‘availability’ : ‘2012-08-04T01:37:47Z/2012-08-04T22:11:34’

Notice that the first time has a Z at the end, but the second one does not. Z means Zulu time, or UTC. The second time, because it does not have a Z, is specifying a local time (UTC-4 in your case). That means that that availability is equivalent to writing:

‘availability’ : ‘2012-08-04T01:37:47Z/2012-08-05T02:11:34Z’

Does that help explain what you’re seeing at all? I’m still a little confused because you said the route should be 44 minutes, but that looks like one day and 44 minutes. Still, using a consistent time zone throughout your CZML should make it easier to figure out what’s going on, at least.


Hi Kevin,

Yes, that makes a lot of sense. Thank you for the explanation. Now my code is working perfectly!

Also, that was an error in the code that I posted. The 'availability' should have been: 'availability' : '2012-08-04T01:37:47Z/2012-08-03T22:11:34' in which case it is a 44 minute time interval rather than a 1 day and 44 minute interval.