🔥 How to Format Dates in JavaScript 2023

preview_player
Показать описание

Learn how to format dates and times in JavaScript without adding an extra dependency to your project.

👇 Follow Me On Social Media:
Рекомендации по теме
Комментарии
Автор

I was waiting for this update to become mainstream. That's why I love javascripts

mohammedezzinehaddady
Автор

But it’s still needs an extra calculation to answer a question “What time will be in city T when at the city S is hh:mm:ss”. Date object is still the same as all these years, so it can be created only UTC and local timezone. You don’t have an option to create a date in any specified timezone. But Intl helps to get a target date and time in string format using IANA representation of timezones. I hope we will get new Date object so that we can forget about moment.js, dayjs, etc

aleksandrgorodnichev
Автор

Yes this is very handy tool,
We actually can pass integer, string and date object to the Date constructor.
It's been a while since I commented on your videos so here I am 😁

Thanks Dave

ahmad-murery
Автор

This is actually pretty good
No packages neeeded

alexanderac
Автор

definitely long overdue glad its finally out

npf
Автор

This is a game changer for me nice job sir!

Universal-Code.
Автор

I hope this can replace niche functions too: like getting language specific monthNames

BenRangel
Автор

Thanks Dave
In a recent Next project there was this date-fns library taking a lot of space

dwd
Автор

It worked on standard javascript page, even when I changed timezones on my PC, it still gave me a good hour of the country current hour.
But somehow it didn't worked on my next.js page.
I had to use date-fns with date-fns-tz to get correct time zone hour of an country.

WarframeCrunch
Автор

Why can't this be a method on the date object itself?

duarteribeiro
Автор

What's the difference between this and Date.toLocaleDateString()?

QkeleQ
Автор

We need date manipulation and timezone conversion to replace date-fn

mailtochung
Автор

Don't forget polyfills to make it works well on iOS with react native 😇

Tyhupo
Автор

Now i think i have to update my package.json

pawanbhatt
Автор

Can you please tell me how can i learn JavaScript in 2 months?

Universal-Code.
Автор

could you do a short video on new Date().
new Date("1963-11-13T07:24:00Z")
new Date(1963, 11, 17); the month is 0-indexed
for the first not. What is the z? How can you get it for the second specification?

patite
Автор

Third parties are still the way to go unless you have a very shallow use of dates

Raaampage
Автор

30 YEARS IT WOULD TOOK,

CONSTRUCTING " DATABASE " ! _1

johnwilsonpanaligan
Автор

The main problem now is adding different timezones.

federicoraulmaciasaparicio
Автор

Moment js will be obsolete soon like jquery

General_Aladeen