Format a Javascript Date to HTML5 time element datetime using moment.js
var html5datetime = moment(yourDate).format('YYYY-MM-DDTHH:mm:ssZ')