-
Answer # 1
You can do it like this. The date must be specified in a variable
fromDate
const fromDate= '14.02.2022'.split(".") const date= new Date(fromDate[2], fromDate[1] -1, fromDate[0]) const formatter= new Intl.DateTimeFormat('ru', { month: 'short' }); const month= formatter.format(date); console.log(`${date.getDate()} ${month} ${date.getFullYear()}`) //Feb 14th 2022
-
Answer # 2
This should help
new Date().toLocaleString('ru', { year: 'numeric', month: 'long', day: 'numeric' });
with today's date it will work. But I get exactly in the format 02/24/2022
oksana Ткачик2022-02-14 09:36:33
Related questions
- javascript : How do I make sequential ajax /fetch requests correctly?
- javascript : Subscriber counter
- javascript : The "Resize ()" event fires on the phone even if you just scroll the page
- javascript : How do I add the required attribute to only the selected radio button?
- javascript : How do I make a select valid?
- javascript : How do I validate select?
- javascript : jquery send ajax only 1 request
- javascript : How to determine if an element is within the scope of the browser window?
- javascript : Opening a modal window depending on a button
larn.javascript.ru/datetime
Max Watson2022-02-14 09:21:25