Loading video...

Video Failed to Load

Go Home

It's 2026. You don't need a library for formatting dates in JavaScript. Just use Intl 👇

148,678 views • 10 months ago •via X (Twitter)

36 Comments

Asmir's profile picture
Asmir10 months ago

@YBenlemlih For better performance, use

kkkooo's profile picture
kkkooo10 months ago

@YBenlemlih It’s 2026, why not use Temporal🤨

Alexander Codes's profile picture
Alexander Codes10 months ago

@YBenlemlih how do you make these code animations?

Josef Bender's profile picture
Josef Bender10 months ago

👇

Alexander Codes's profile picture
Alexander Codes10 months ago

@YBenlemlih thank you!

Kayvan Arianpour's profile picture
Kayvan Arianpour10 months ago

@YBenlemlih Unfortunately JS does not handle the timezone issue well. If you don’t have this issue, good for you. I will wait for Temporal. Till then, still in 2026, I use date-fns

Lingo.dev's profile picture
Lingo.dev10 months ago

@YBenlemlih That’s great news 👍

aymericzip's profile picture
aymericzip10 months ago

@YBenlemlih I guess 2026 has to be formatted using Intl

Samador 🔥's profile picture
Samador 🔥10 months ago

@YBenlemlih There's 'toLocaleString()' which I believe you'll easily remember. Works the same as Intl

Yash Solanki's profile picture
Yash Solanki10 months ago

@YBenlemlih but library still makes the job much easier. I use dayjs, and it works seamlessly i'l save this for the future, thanks!!

Ann Liao's profile picture
Ann Liao10 months ago

@YBenlemlih What's the different between this and dayjs?

Anish B Ghosh's profile picture
Anish B Ghosh10 months ago

@YBenlemlih javascript has so many hidden treasures. it's good to have a treasure hunter like you amongst us.

RubyWithoutRailsWithStaticTypes's profile picture
RubyWithoutRailsWithStaticTypes10 months ago

@YBenlemlih Technically we never needed any libraries, even back in the jquery days. But JavaScript sucks on every level, and everyone desperately attempts to use band aids & duct tape

Ville Saukkonen's profile picture
Ville Saukkonen10 months ago

@YBenlemlih Intlesting 🤔

Colin Richardson's profile picture
Colin Richardson10 months ago

@YBenlemlih "You don't need a library".. except, you kinda do. Because, yes, you got the correct format.. but you got the wrong timezone.. 14:35:20Z is gonna be like 8:35AM for most of America right?

Cody's profile picture
Cody10 months ago

@YBenlemlih i knew intl was the move years ago

Subhadip Mishra's profile picture
Subhadip Mishra10 months ago

@YBenlemlih New update

Justin Schroeder's profile picture
Justin Schroeder10 months ago

@YBenlemlih For more control and parsing:

Gamatek 🇫🇷's profile picture
Gamatek 🇫🇷10 months ago

@YBenlemlih same for time, number etc

Renato Carneiro's profile picture
Renato Carneiro10 months ago

@YBenlemlih date-fns

Beka's profile picture
Beka10 months ago

@YBenlemlih My AI agent already used this

Hamza Ahmad's profile picture
Hamza Ahmad10 months ago

@YBenlemlih Absolutely!

Ankit Mohanta's profile picture
Ankit Mohanta10 months ago

@YBenlemlih There are tons of npm packages that do the same thing and export their custom hooks and functions, but under the hood, they are using this exact utility

Sanchita's profile picture
Sanchita10 months ago

@YBenlemlih

Romain's profile picture
Romain10 months ago

@YBenlemlih Happened to me today : ki() is compiled name for Angular's formatDate() function. Silly us trying to format a string instead of a Date, but 1) it doesn't bother Angular as it still tries to cast to a Date then format 2) it was doing fine with "2025-12-23" soooo

Sevalla's profile picture
Sevalla10 months ago

@YBenlemlih JS has some hidden gems.

Ypatios Chaniotakos's profile picture
Ypatios Chaniotakos10 months ago

@YBenlemlih Cool

Andrii Shupta's profile picture
Andrii Shupta10 months ago

@YBenlemlih In more complex apps, formatting is only ~10% and using Luxon (and other libs) gives better api and more functionality: timezones/offsets, add/remove days/minutes, startOf/endOf, from/to ISO, DateTime<isValid?>, etc

Adetunji | Software Engineer (Web & Mobile)'s profile picture
Adetunji | Software Engineer (Web & Mobile)10 months ago

@YBenlemlih This is so cool I learn it this year and never installed a library again

Habibur Rahman's profile picture
Habibur Rahman10 months ago

@YBenlemlih I am happy that JS has this built-in but the DX of date-fns is way better

Hosein Hamzenejadi's profile picture
Hosein Hamzenejadi10 months ago

@YBenlemlih I used to use moment.js Intl is much better and it's native

blank's profile picture
blank10 months ago

@YBenlemlih I guess this is the end of the road for me with date-fns.

thym's profile picture
thym10 months ago

@YBenlemlih cool animation!

tanav's profile picture
tanav10 months ago

@YBenlemlih Crazy library

Glitchmon's profile picture
Glitchmon10 months ago

@YBenlemlih Bro prepared the post for next year's algo

Marwan Baz's profile picture
Marwan Baz10 months ago

@YBenlemlih The new animation posts are really nice, and they are going viral 🚀

Related Videos