I want to convert 2016-01-01 00:00:00 into ISO format in Jquery. The  toISOString()  function is not working and is returning error on console :Uncaught TypeError: date.toISOString is not a function. How to convert a date string into an ISO date format in Jquery?