Loading topic
Date object came from a quick port of Java's java.util.Date in 1995. Java replaced that class years ago. JavaScript kept it. Temporal is the replacement: a set of new types built into the language for dates, times, time zones, and durations. This chapter covers the problems with `Da2 min readDate object. It also assumes Temporal is available, either natively or through the polyfill from the previous chapter.2 min readconst and let, how JavaScript passes object references, and how strict mode works. It also assumes that Temporal is available, either natively or through the polyfill set up in an earlier chapter.2 min readTemporal is available, either natively or through the polyfill set up in an earlier chapter. You should also know the difference between exact time and wall-clock time from the types overview.2 min readtry/catch, and have a working Temporal global, either native or from the polyfill set up earlier. It also assumes you know the Plain types and Temporal.Instant from the previous chapters.1 min readDate object.2 min readTemporal.Instant as an exact moment in time. It explains what a time zone is in Temporal and how to name one correctly.2 min readTemporal.Instant, the Plain types, and IANA time zone identifiers such as America/New_York. The examples use a global Temporal, either native or from the polyfill set up earlier.2 min readfrom() and know that Temporal objects are immutable. The examples import the polyfill so they run in any Node.js version. If your runtime has native Temporal, you can drop the import.2 min readPlainDate values and how to call add, subtract, and with on them. Code samples use the Temporal fallback setup from the runtime support chapter.2 min readfrom() and how Temporal.Duration stores and prints amounts of time. The examples import the polyfill. If your runtime has native Temporal, you can use the global instead.1 min readfrom() and constructors, and that you know the difference between exact time (Instant, ZonedDateTime) and wall-clock time (the Plain types). The examples run in Node.js with ES modules. They use the native Temporal global if the runtim2 min readTemporal.ZonedDateTime and how add treats calendar units differently from exact units. Here you will see what Temporal does when a local time is skipped or repeated, and how you can choose the result yourself.2 min readfrom(), how Duration balancing works, and how ZonedDateTime relates to Instant. The examples use the global Temporal, either native or from the polyfill set up earlier.2 min readfrom() and know the difference between the Plain types and ZonedDateTime. It also helps to have used Intl.DateTimeFormat with legacy Date. The examples assume Temporal is already available, either natively or through the setup from t2 min readDate objects. This chapter shows how to move values across that boundary without silently losing information. It assumes you already know Temporal.Instant, `ZonedDateTime2 min readfrom(), know the difference between Instant, ZonedDateTime, and the Plain types, and have used JSON.stringify and JSON.parse. The examples import the polyfill. If your runtime has native Temporal, you can remove the import.2 min read