13
submitted 1 day ago* (last edited 1 day ago) by [email protected] to c/[email protected]

Firefox 139.0 released yesterday, with support for the Temporal JavaScript API.

I explored the API, writing down the most relevant interfaces into a reference or cheat sheet.

It's certainly and finally a thorough API for handling temporal information. Working with zoned datetime across time offsets and time zones can get very confusing, though.

I love how you can work with them though, especially with durations.

console.log(Temporal.PlainDateTime.from('2025-02-05T08:00:00'))

console.log(Temporal.Now.plainDateTimeISO("Europe/Berlin"))

console.log(Temporal.Now.plainDateTimeISO().add('PT2M0.2S').subtract('PT0.5S').since(Temporal.Now.plainDateTimeISO()))

console.log(Temporal.ZonedDateTime.from('2025-02-05T13:57:35.777888[Europe/Berlin]').withTimeZone('Europe/London'))
no comments (yet)
sorted by: hot top new old
there doesn't seem to be anything here
this post was submitted on 28 May 2025
13 points (100.0% liked)

Web Development

3956 readers
4 users here now

Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development

What is web development?

Web development is the process of creating websites or web applications

Rules/Guidelines

Related Communities

Wormhole

Some webdev blogsNot sure what to post in here? Want some web development related things to read?

Heres a couple blogs that have web development related content

CreditsIcon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 2 years ago
MODERATORS