Convert JS date time to SQLSERVER datetime

JavaScript
new Date().toISOString().slice(0, 19).replace('T', ' ');
Source

Also in JavaScript: