toISOString() function not working.
I have this simple script to run-
-
- var date = '2016-01-01 00:00:00';
- var n = date.toISOString();
-
- alert(n);
But instead it returns error: Uncaught TypeError: date.toISOString is not a function
I want to convert the date string into ISO date format which is compatible with firefox. However its not working in Jquery. Is there a different function for ISO date format conversion for Jquery or is there any error in my script?