title: How Can I format Date in typescript?
body: <p>When I do new Date() in <code>Angular2</code> (typescript) I GET -> DATEE Wed Jul 18 2018 09:13:40 GMT+0200</p>
  
  <p>The problem is that I have sent Date to Java but Java doesn't let this format.</p>
  
  <p>Java only let ,dd/mm/aaaa or aaaa/mm/dd but he doesn't let Wed Jul 18 2018 09:13:40 GMT+0200.</p>
  
  <p>I try in Angular create a new format but always get String, but I need format Date because my class In Java get Date.</p>
  
  <pre><code>let myDate: Date, myDay, myMonth, myYear;
  
  myDate = new Date();
  myDay  = myDate.setUTCFullYear;
  console.log(myDay);
  myDay  = myDate.toISOString;
  console.log(myDay);
  console.log(typeof(myDay));
  console.log(new Date(myDay));
  </code></pre>
  
  <p>I can not install libraries that angular does not bring by default for example: "moment".
  Ty</p>