In JavaScript we can create Date object by either constructor ( new Date() ) or by using Date.parse() method.

In both cases (optionally) we can provide dateString. MDN notes it should be:

A string representing an RFC2822 or (a variant of) ISO 8601 date (other formats may be used, but results may be unexpected).