I want to covert a full date to a abbreviated form like for example :- 15 September 2020 to 15 SEP 20 in javascript i have arrays of date
Asked
Active
Viewed 41 times
0
-
1Does this answer your question? [How to format a JavaScript date?](https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date) – depperm Jun 16 '21 at 11:13
1 Answers
0
Try this code:
const datum = '15 September 2020';
const words = datum.split(' ');
const str = `${words[0]} ${words[1].slice(0, 3).toUpperCase()} ${words[2].slice(2, 4)}`;

aleksxor
- 7,535
- 1
- 22
- 27

Redberry57
- 36
- 4