Skip to content

Clock & Time

Clock configuration for the viewer timeline, plus JulianDate for ISO 8601 times in time-dynamic properties.

import cesiumkit

viewer = cesiumkit.Viewer(
    clock=cesiumkit.ClockConfig(
        start_time=cesiumkit.JulianDate.from_iso8601("2026-07-14T18:00:00Z"),
        stop_time=cesiumkit.JulianDate.from_iso8601("2026-07-14T19:00:00Z"),
        current_time=cesiumkit.JulianDate.from_iso8601("2026-07-14T18:30:00Z"),
        multiplier=60,
    ),
    should_animate=True,
)

clock

Clock and time types for cesiumkit.

Classes:

Name Description
JulianDate

Wrapper for Cesium.JulianDate.

ClockConfig

Configuration for the Cesium clock/timeline.

JulianDate

Bases: CesiumBase

Wrapper for Cesium.JulianDate.

Methods:

Name Description
to_czml

Serialize to the CZML ISO 8601 time string.

from_iso8601

Create a JulianDate from an ISO 8601 string.

from_datetime

Create a JulianDate from a Python datetime.

now

Create a JulianDate for the current time.

to_czml

to_czml() -> str

Serialize to the CZML ISO 8601 time string.

from_iso8601 classmethod

from_iso8601(iso_string: str) -> JulianDate

Create a JulianDate from an ISO 8601 string.

from_datetime classmethod

from_datetime(datetime_obj: datetime) -> JulianDate

Create a JulianDate from a Python datetime.

now classmethod

now() -> JulianDate

Create a JulianDate for the current time.

ClockConfig

Bases: CesiumBase

Configuration for the Cesium clock/timeline.

Methods:

Name Description
to_js_statements

Generate JS statements to configure the clock after viewer creation.

to_js_statements

to_js_statements(viewer_var: str = 'viewer') -> list[str]

Generate JS statements to configure the clock after viewer creation.