In JS function, how to set current date time to an object field?

0
In JS function, how to set current date time to an object field? The field is of type DateTime
asked
1 answers
2

Hi Yin,

 

function getCurrentDateTime() {
  return new Date();
}
function setCurrentDateTimeToObjectField(myObject, attributeName) {
  var currentDate = getCurrentDateTime();
  myObject.setAttribute(attributeName, currentDate);
}

Let me  know, if you have any issues,

Hope it helps!!

answered