Sample scripts

NOW_ISO (Java)

This function reads the system clock and returns the ISO format of it.

function NowIso(InputValue,Parameter1,Parameter2,Parameter3,Parameter4)
{
     //Get the system clock
     var d = new Date();
     //Year
     var c = d.getFullYear() + "-";
     //Month
     var h = (d.getMonth() + 1);
     if (h < 10)
          c += "0" + h + "-"
     else
          c += h + "-";
     //Day
     h = d.getDate();
     if (h < 10)
          c += "0" + h + " "
     else
          c += h + " ";
     //Hours
     h = d.getHours();
     if (h < 10)
          c += "0" + h + ":"
     else
          c += h + ":";
     //Minutes
     h = d.getMinutes();
     if (h < 10)
          c += "0" + h + ":"
     else
          c += h + ":";
     //and the seconds
     h = d.getSeconds();
     if (h < 10)
          c += "0" + h
     else
          c += h;
     return c;
}