Skip to main content

Temporal

Base interface for date/time objects that support standard string formatting.

Implemented by DateTime and LocalDate.


Methods

MethodReturnsDescription
toISOString()stringISO 8601 representation
toString()stringHuman-readable string representation
const dt = DateTime.now();

dt.toISOString(); // "2024-09-03T12:34:56.789Z"
dt.toString(); // "2024-09-03T12:34:56.789Z"