DEV Community

0 seconds of 4 minutes, 56 secondsVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
04:56
 
Brian Douglas for GitHub

Posted on β€’ Edited on

5 3

Learn how JavaScript advances DateTime with proposal-temporal

There comes a time in every developer's life where they need to parse a string representation of a date. I had the pleasure of talking with Maggie Pint about a new feature currently in stage 2 with the tc39 committee, temporals.

Learn how to contribute to the next version of JavaScript first issue.

This proposal allows a JavaScript programmer the ability to write code for finding out the current timezone difference between their's and another time zone.

const { Temporal } = require('proposal-temporal')

let londonTz = Temporal.TimeZone.from('Asia/Shanghai');

console.log(now.toString(londonTz));
Enter fullscreen mode Exit fullscreen mode

A complete polyfill can be found here. Feel to test it out today and experiment with the polyfill, but keep in mind it is not production ready yet.

GitHub logo tc39 / proposal-temporal

Provides standard objects and functions for working with dates and times.

Temporal

Provides standard objects and functions for working with dates and times.

Status

This proposal is currently Stage 3 and was reviewed for Stage 3 by Richard Gibson, Bradley Farias, and Daniel Ehrenberg.

This proposal is now in the hands of ECMAScript engine implementers, so the bar for making API changes is extremely high Nonetheless, changes may occur as the result of feedback from implementation in JS engines. Editorial changes to the spec and bug fixes to the spec, tests, and docs are also ongoing, as is customary for Stage 3 proposals. Additional tests and documentation content are also being added during Stage 3.

Champions

…

I share only one feature from the proposal, I encourage you to read more info in the spec and test it out today in consoles.

Join us live for Open Source Fridays

If you’re looking for a deep dive into contributing to open-source projects like this, join us on Fridays on Twitch. You can find the future schedule on GitHub Virtual Meetup page.

If you missed our previous OSF stream, or want to rewatch, you can find the full video over on our YouTube.

Image of Stellar post

πŸš€ Stellar Dev Diaries Series: Episode 1 is LIVE!

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

Top comments (0)

Neon image

Next.js applications: Set up a Neon project in seconds

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Get started β†’

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❀️