The Javascript Date type doesn't support custom format strings like "yyyyMMddHHmmss".
But it does provide a number of methods that return the date as a string in a specific format. The toLocaleString() methods additionally accept a locale plus options that provides a considerable degree of customization. There is a link to that article at the bottom of the page.
date.toString() date.toDateString() date.toLocaleDateString( [locales, [options]] ) date.toTimeString() date.toLocaleTimeString( [locales, [options]] ) date.toUTCString() date.toGMTString() date.toISOString() date.toLocaleString( [locales, [options]] ) date.toJSON() The Date Object:
var now = new Date();
var str = now.toLocaleString(locales, options);
console.log(str);