The format()
function is not standard for Date
objects in javascript.
You most likely saw this in an application that uses a date formatting library such as moment.js.
http://momentjs.com/
moment().format('MMMM Do YYYY, h:mm:ss a');
Your example can be rewritten in moment.js as follows:
var timestamp = moment().format("DD/MM/YYYY HH:mm:ss") + " (" + GetLoggedUserName() + ")";
source share