Date.parse() With Server Side Strings24 April 2018
The simplest way to ensure that it works as you expect is to return your strings in ISO 8601 compliant format such as:
This will parse a date or a date and a time correctly. All times are treated as UTC. The topic of time zones and offsets is beyond the scope of this simple post. But, if you need to return a time with an offset then you want:
This will give you a Date object with the time set to 3 hours ahead of the specified time.
It’s funny how often date time string parsing confuses even experienced developers. If you need a thorough reference then the best I have found on this subject is here.