Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Temporal's main data type is ZonedDateTime.

PlainDateTime is there because it is necessary sometimes. The Temporal docs even outline some cases where you might want to use it: https://tc39.es/proposal-temporal/docs/plaindatetime.html

Temporal also makes it pretty hard to misuse its types. For example:

    >> dt = Temporal.PlainDateTime.from("2025-01-25T00:00Z")
    Uncaught RangeError: Z designator not supported for PlainDateTime
        ToTemporalDateTime ecmascript.mjs:1198
        from plaindatetime.mjs:286
        <anonymous> debugger eval code:1


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: