title: Passing Date argument to function
body: <p>How to pass argument of Date to another function? My code:</p>
  
  <pre><code>var myDate = new Date(data.GetOPCResult.DateTime.match(/\d+/)[0] * 1);
  var datlabel = document.getElementById("ct");
  datlabel.innerHTML = GetTime(myDate);
  </code></pre>
  
  <p>And GetTime function code:</p>
  
  <pre><code>function GetTime(DateTime) {
      var month = (DateTime.getMonth() &lt; 10) ? "0" + (DateTime.getMonth() + 1) : (DateTime.getMonth() + 1);
      var day = (DateTime.getDate() &lt; 10) ? "0" + DateTime.getMonth() : DateTime.getMonth();
      var hour = (DateTime.getHours() &lt; 10) ? "0" + DateTime.getHours() : DateTime.getHours();
      var minute = (DateTime.getMinutes() &lt; 10) ? "0" + DateTime.getMinutes() : DateTime.getMinutes();
      var second = (DateTime.getSeconds() &lt; 10) ? "0" + DateTime.getSeconds() : DateTime.getSeconds();
      return DateTime.getDate() + "." + month + "." + DateTime.getFullYear() + " " + hour + ":" + minute + ":" + second;
  }
  </code></pre>