title: How do you format a Date/Time in TypeScript?
body: <p>I've been having some trouble trying to get a <code>Date</code> object in TypeScript to format the way I want it to. </p>
  
  <p>I have a class <code>Module</code> which is defined as:</p>
  
  <pre><code>export class Module {
  
      constructor(public id: number, public name: string, public description: string, 
                   public lastUpdated: Date, public owner: string) { }
  
      getNiceLastUpdatedTime(): String {
  
          let options: Intl.DateTimeFormatOptions = {
              day: "numeric", month: "numeric", year: "numeric",
              hour: "2-digit", minute: "2-digit"
          };
  
          return this.lastUpdated.toLocaleDateString("en-GB", options) + " " + this.lastUpdated.toLocaleTimeString("en-GB", options);
      }
  }
  </code></pre>
  
  <p>When I call the method with the following code:</p>
  
  <pre><code>    let date = new Date(1478708162000); // 09/11/2016 16:16pm (GMT)
      let module = new Module(1, "Test", "description", date, "test owner");
      console.log(module.getNiceLastUpdatedTime());
  </code></pre>
  
  <p>I end up with the following printed in the console:</p>
  
  <pre><code>'9 November 2016 16:16:02 GMT'
  </code></pre>
  
  <p>What I want to see is:</p>
  
  <pre><code>09/11/2015 16:16
  </code></pre>
  
  <p>I've had a look at the documentation at: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString" rel="noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString</a>  and I still can't see what I'm doing wrong (I know this is a JavaScript API documentation but I'm pretty sure that's what TypeScript is using under the hood).</p>