'I have a variable that outputs a string of dates, how can I change the format of all the dates in that string? [duplicate]
In JavaScript I have a variable that contains a series of dates all formatted like this:
5/3/2021 12:00:00 AM
How can I update that variable to change the format of the date to this:
May 3
Solution 1:[1]
dates.map(d => d.toDateString().split(' ').slice(1, 3).join(' '))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Clem |
