
Hasty Treat - Temporal Date Objects in JavaScript
About this episode
In this Hasty Treat, Scott and Wes talk about Temporal Date Objects in JavaScript — a WICKED AWESOME API for working with times and dates.
Sentry - Sponsor If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”.
Show Notes 05:11 - Temporal Now
You can get now Temporal.now.___
07:58 - Temporal Instants
A Temporal.Instant represents a fixed point in time, without regard to calendar or location. Most common way to show it is nanoseconds since unix epoch.
Can be formatted a few different ways.
09:59 - Calendar
Support for different types of calendars
11:43 - Durations
Temporal.Duration There are .from and .add and subtract() methods
12:47 - Other interesting parts
Timezones Temporal.ZonedDateTime
Temporal.YearMonth - represents a ym = new Temporal.YearMonth(2019, 6) // => 2019-06
14:51 - Polyfill (unstable)
Links Fixing JavaScrip Date - Maggie Pint
https://github.com/tc39/proposal-temporal
https://github.com/tc39/proposal-temporal/blob/main/docs/calendar.md#methods
https://github.com/tc39/proposal-temporal/blob/main/docs/duration.md
Tweet us your tasty treats! Scott’s Instagram
LevelUpTutorials Instagram
Wes’ Instagram
Wes’ Twitter
Wes’ Facebook
Scott’s Twitter
Make sure to include @SyntaxFM in your tweets
More from Syntax - Tasty Web Development Treats
Scott and Wes get into closing the gap between your taste and your skills, with tips on design inspiration, snappier animations and easing. They also share an entry-level setup for recording video les…
Scott and CJ dig into Exact, Expo’s new Rust-based runtime that takes one codebase to web, iOS, macOS and Linux with no React Native involved, plus Bombadil’s property-based testing for web UIs. They…
Scott and Wes sit down with Michael Arnaldi to dig into Effect v4 and why guardrails matter now that AI agents are writing so much of our code. They discuss going zero dependencies, a 5x smaller bundl…
Scott and Wes sit down with GitHub’s Kyle Daigle to ask what the hell is going on with GitHub: the downtime, the agent traffic spike, and the infrastructure overhaul decoupling storage from compute. P…
Wes, Scott, and CJ are back with two weeks of news: Reddit is forcing everyone to log in, r/opensource bans anything AI, and CSS-Tricks is independent again. Plus Anomaly's Hex dictation app, Mitchell…