Control how angularjs converts date to json string <p>I have an object containing a javacsript date. Something like this:</p> <pre><code>var obj = { startTime: new Date() .... } </code></pre> <p>When Angularjs converts the object to JSON (for example, when sending it over $http), it converts the date to a string such as:</p> <pre><code>2015-12-20T15:35:15.853Z </code></pre> <p>I would like to have a timestamp instead of this string. What is the best way to achieve this?</p>