Parse An ISO Date In JavaScript
The native [TODO: Code shorthand span ] JavaScript object can parse ISO style date string. For example, this one without a timezone :
javascript
const dateString = '2021-11-12T02:03:03'
const dateObject =
That code will produce a date object that will print out this if logged :
2021-11-12T07:03:03.000Z
Note that the time has moved to Zulu (or GMT) time. That is, the hour shifted from 2 to 7.
Once the date is parsed, you use functions like :
javascript
.
.
.
And all the other ones listed here
Note, this is done without using [TODO: Code shorthand span ] which is "strongly discouraged due to browser differences and inconsistencies." ( source