var d = new Date();
formattedDate = d.toLocaleDateString('en-US', {
month: '2-digit',
day: '2-digit',
year: 'numeric',
}).replace(/\//g, '/');
var formattedTime = d.toLocaleTimeString('en-US', {
hour: '2-digit',
minute: '2-digit',
hour12: true,
});
$('#field').val(formattedDate + ' ' + formattedTime);