Altea Healthcare interview question

How to extract datetime in a string in Javascript without using any libraries.