How to convert a numeric date to another form?
-
Good afternoon.
I got the following date: 2020-11-10T12: 10: 16.000000Z
I need to translate it into this format:
11/10/2020.
Please tell me how this can be implemented?JavaScript Sienna Beck, Oct 28, 2020 -
new Date ('2020-11-10T12: 10: 16.000000Z')
And then process it as you want. For example
const date = new Date('2020-11-10T12:10:16.000000Z')
console.log(new Intl.DateTimeFormat('en-US').format(date)); // 11/10/2020
console.log(new Intl.DateTimeFormat('ru-RU').format(date)); // 10.11.2020
console.log(new Intl.DateTimeFormat(navigator.language).format(date)); // Зависимо от языка пользователя
Intl.DateTimeFormatAnonymous
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!