var dt = new Date(); item.set_item(dt);
But don’t worry about this. There is a workaround. You just need to convert the date into an ISO string. On SharePoint, Microsoft Ajax library offers by default a format function for Date object.
var dt = new Date(); item.set_item(dt.format('yyyy-MM-ddTHH:mm:ssZ'));
Workaround is simple. Nothing complicated in this. In general, I think SharePoint is a great platform for development, if you find the right information.