I am trying to extract date from a string 20170901000000
. new Date(string)
returns Invalid Date
. The date string looks pretty straightforward to me but apparently javascript doesn't take it.
What formats does javascript new Date()
method take? Is there a package taking more formats of date string?
Edit: The formats are from random users. The YYYYMMDDhhmmss
is only one example. The package has to be able to determine what format it is by itself and parse it.