Standard built-ins

Temporal.PlainDateTime

Try the free JavaScript compiler

Local calendar and clock fields without a time zone. Temporal values are immutable. This guarded example demonstrates construction when available; the Temporal branch is NOT RUN locally. Stage 4 does not guarantee implementation support.

Formal Syntax & Structure

javascript syntaxjavascript
Temporal.PlainDateTime.from(value)

Parameters & Attributes

NameTypeDescription
valueString | ObjectCompatible representation for from; consult type-specific grammar.

Return Value

Temporal.PlainDateTime

Constructed immutable value.

Working Example

Example Snippetjavascript
if(typeof Temporal==="object"&&typeof Temporal.PlainDateTime?.from==="function"){console.log(Temporal.PlainDateTime.from("2024-01-01T12:30").toString());}else{console.log("Temporal unavailable");}
JavaScript Reference