Returns date and time in requested format.
formatDateTime(dateStr, format)

dateStr | string or number, date in common format
format | string, format to output

The str argument can be (1) a JavaScript Date, (2) a Unix epoch, (3) any standard date, which will be used to create JavaScript Date object. To ensure correct translation it is best to pass a JavaScript Date or a full format with time zone: "2013/12/21 19:03:59 PST".
This method will call w2utils.formatDate and then w2utils.formatTime methods.
var a = w2utils.formatDateTime((new Date()), 'mm-dd-yyyy|h:m pm'); console.log(a);