I need to parse data from the server, some of which are supposed to be date-time values. The expected format is in the form '2017-06-16T09:00:00Z'
. How can I validate that an input is in this format before I convert it into a Date object? Only this specific date-time format can be accepted as correct input for my functionality.
Apparently this format is some kind of standard convention. I would prefer not to add new libraries into my system if possible, so that means answers using AngularJS (my system is already using that) or pure JavaScript is preferred.