Change Timeline from UTC to Local Time

This has been asked several times before however I haven’t seen an answer for this.

Is there a way to view the Timeline in local time format not UTC?

This was answered here: How to fix cesium timezone?. You can override the timeFormatter or dateFormatter functions which take a date/time and return a string that appears in the clock widget.

To handle displaying the timezone correctly you’ll probably want to use another library to take care of that formatting. Here is a JSFiddle that uses the Luxon library to set the time to the user’s local timezone, and you can use this to set the time to a specific timezone as well:

Thank you!

I found something similar however it wasn’t working.

This will assist greatly. Cheers

1 Like

@omar,

Can the same thing be done for the Timeline bar?

I can see this mentioned in a few spots however I don’t believe makeLabel exists anymore?

_viewer.timeline.makeLabel = function(date) {
var gregorianDate = Cesium.JulianDate.toGregorianDate(date);
return gregorianDate.year;
};