lingwu
lingwu

Reputation: 41

Leaflet TimeDimension show local time

Is there a way to not display UTC time, only display local time? Because of the time difference, the UTC time is a bit strange.

I refer to this website.

enter image description here

Upvotes: 0

Views: 723

Answers (1)

LunaMooncraft
LunaMooncraft

Reputation: 13

When you click on the time section the UTC time change to local time and visa versa. You can set the default to Local time, if you add timeZones: ["Local", "UTC"] and change the sequence from the timeZones array (https://github.com/socib/Leaflet.TimeDimension#ltimedimensionplayer)

const timeDimensionControl = L.control.timeDimension({
    loopButton: true,
    autoPlay: false,
    timeZones: ["Local", "UTC"]
});

Upvotes: 1

Related Questions