function displayTime(str2) {
var str = "";
var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
var seconds = currentTime.getSeconds()
var milliseconds = currentTime.getMilliseconds()
if (minutes < 10) {
minutes = "0" + minutes
}
if (seconds < 10) {
seconds = "0" + seconds
}
str += hours + ":" + minutes + ":" + seconds + ":" + milliseconds;
return str2 + ": " + str;
}
Siebel Open UI Example:
console.log("PR Invoked" + displayTime("@"));
Hope it helps.