Altea Healthcare Interview Question

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