title: How to create an extension method in TypeScript for 'Date' data type
body: <p>I have tried to create an extension method in TypeScript based on this discussion (<em><a href="https://github.com/Microsoft/TypeScript/issues/9" rel="noreferrer">https://github.com/Microsoft/TypeScript/issues/9</a></em>), but I couldn't create a working one.</p>
  
  <p>Here is my code,</p>
  
  <pre><code>namespace Mynamespace {
      interface Date {
          ConvertToDateFromTS(msg: string): Date;
      }
  
      Date.ConvertToDateFromTS(msg: string): Date {
          //conversion code here
      }
  
      export class MyClass {}
  }
  </code></pre>
  
  <p>but its not working.</p>