How To Easily Format Dates In JavaScript

How To Easily Format Dates In JavaScript

Web Dev Simplified

1 год назад

107,038 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Ahmed Lemssiah
Ahmed Lemssiah - 22.06.2023 16:08

toLocaleDateString()
do the same?

Ответить
Fluffy Bunny
Fluffy Bunny - 25.05.2023 23:51

Nah still moment or day js is fine one liner code

Ответить
Kim
Kim - 29.04.2023 14:48

Wow! This is incredible

Ответить
Code-X
Code-X - 21.04.2023 11:13

How to display format same as user's system ? instead of hard coding en-gb or en-us or any other. So that if you change region it changes date format automatically.

Ответить
Omachoko Mark
Omachoko Mark - 09.02.2023 21:32

Thanks Kyle.

Ответить
🇳🇬 Emmanuel Odii
🇳🇬 Emmanuel Odii - 31.01.2023 15:14

please Kyle, create a full video on Intl.RelativeTimeFormat.

Ответить
kish
kish - 25.01.2023 23:14

Moment js is the best library for managing time and date.

Ответить
MTalt's planes
MTalt's planes - 22.01.2023 11:33

Time to skid

Ответить
javier serna
javier serna - 18.01.2023 00:00

I'm from Spain and I appreciated this.🙏

Ответить
Punker Tøs
Punker Tøs - 16.01.2023 04:14

I find this very handy, but it seems like it doesn't work as intended on iPhone Safari browser. Typically!

Ответить
Scorpion
Scorpion - 16.01.2023 04:05

I HATE JS

Ответить
freakaefari
freakaefari - 13.01.2023 17:27

but how do you put them TIMEZONE-CORRECT (when receiving zulu time from API) as value in to the html tag <input type="datetime-local" /> ???

Ответить
judgewest2000
judgewest2000 - 11.01.2023 16:17

like it!

Ответить
Redefine
Redefine - 10.01.2023 17:43

Use day JS and get rid of all this hell

Ответить
therealgg13
therealgg13 - 09.01.2023 16:07

can u keep ur head still for once?

Ответить
Faiz Sufrikhan
Faiz Sufrikhan - 09.01.2023 13:38

Why do you make spain format sound like its american? 🤣

Ответить
Kfir Lankry
Kfir Lankry - 05.01.2023 22:12

Been looking for this for ages, thanks kyle!

Ответить
Ben Hays
Ben Hays - 05.01.2023 11:52

Niiiiiice

Ответить
Fatah Haniche
Fatah Haniche - 04.01.2023 10:25

Short & sweet. Thanks for sharing.

Ответить
Daniel Fragoso
Daniel Fragoso - 02.01.2023 03:50

Hi, thanks for the short, is there a way to specify a format mask like yyyy-MM-dd?

Ответить
Arun S P
Arun S P - 01.01.2023 11:04

Yet there is no way we can pass a format string we want in and get the output

Ответить
Joseph
Joseph - 31.12.2022 18:02

dealing with datetime is a pain . I was wrestling to get a static timezone for a restaurant's website opening hours. toLocalestring was not helping in this case.

Ответить
MB
MB - 31.12.2022 16:24

How about the timestamp code lol

Ответить
Gian-Marco
Gian-Marco - 30.12.2022 19:35

that's actually really neat

Ответить
Shortly
Shortly - 30.12.2022 17:58

DateTimeFormat and NumberFormat are blessings.

Ответить
Koen Verheyen
Koen Verheyen - 30.12.2022 10:18

Can you do custom formatting as well? Like if I want "YYYY-MM-DD"?

Ответить
offset
offset - 30.12.2022 06:21

Kyle you need to learn Spanish bro !

Ответить
David López
David López - 30.12.2022 05:10

🇪🇸♥️

Ответить
Inzaghi Posuma Al Kahfi
Inzaghi Posuma Al Kahfi - 30.12.2022 05:04

QUESTION :
How to display an Islamic/Hijri Calendar Dates on JavaScript?

Ответить
Talha shiekh
Talha shiekh - 30.12.2022 04:37

Make a full video on it

Ответить
Go with Christ
Go with Christ - 29.12.2022 23:54

its still shit

Ответить
Pseu da Ciência
Pseu da Ciência - 29.12.2022 22:52

Very cool information!

Ответить
William Chorski
William Chorski - 29.12.2022 22:32

will this eliminate the need for libraries like date-fns?

Ответить
CaMeOn!
CaMeOn! - 29.12.2022 21:38

OMG this is a thing?

Ответить
sharath sharu
sharath sharu - 29.12.2022 20:26

"Spain format" you mean rest of the world

Ответить
kholod nost'
kholod nost' - 29.12.2022 20:25

Is this built in on browsers?

Ответить
Ichirou Takashima
Ichirou Takashima - 29.12.2022 20:04

Do you by any chance track my progress? Because I find it weird that it's too much of a coincidence that I'm actually searching a lot of this regarding dates since yesterday, lmao.

Ответить
Amitylite
Amitylite - 29.12.2022 20:03

Feels like you're a little bit sick. Get well soon Kyle! Appreciate the content!

Ответить