title: Javascript date object, getDate(), getMonth() and getFullYear() of date object in IE and Safari
body: <p>I use this function in my Javascript code in order to format dateTime object into string and this function works fine for Firefox and Chrome but not for IE and Safari. 
  Does anyone know what to do in order to make this also work with Safari and IE?</p>
  
  <p>date Object looks like this in Chrome: Mon Mar 25 2019 00:00:00 GMT+0100 (CET)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function formatDateTimeToString(date) {
    var dd = (date.getDate() &lt; 10 ? '0' : '') + date.getDate();
    var MM = ((date.getMonth() + 1) &lt; 10 ? '0' : '') + (date.getMonth() + 1);
    var yyyy = date.getFullYear();
    var hours = (date.getHours() &lt; 10 ? '0' : '') + date.getHours();
    var minutes = (date.getMinutes() &lt; 10 ? '0' : '') + date.getMinutes();
    return (dd + "." + MM + "." + yyyy + ' ' + hours + ':' + minutes);
  }
  
  console.log(formatDateTimeToString(new Date()));</code></pre>
  </div>
  </div>
  </p>