Turning JSON into date object <p>I have get request here </p> <pre><code>$http.get('php/getactivity.php') .then( function (response) { $scope.data.activities = response.data; }, function (response) { // error handling } ); </code></pre> <p>which gets data from database . in my php</p> <pre><code>&lt;?php include('dbconnect.php'); $result = $conn-&gt;query("SELECT * FROM Activities WHERE EventID =1;"); $outp = ""; while($rs = $result-&gt;fetch_array(MYSQLI_ASSOC)) { if ($outp != "") { $outp .= ","; } $outp .= '{"ActivityDate":"' . $rs["ActivityDate"] . '",'; $outp .= '"StartTime":"' . $rs["StartTime"] . '",'; $outp .= '"EndTime":"' . $rs["EndTime"] . '"}'; } $outp ='['.$outp.']'; $conn-&gt;close(); echo($outp); ?&gt; </code></pre> <p>which gets the date string from the database. An example of the data is as such : </p> <p>Thu Jan 01 1970 11:11:00 GMT+0800 (Malay Peninsula Standard Time)</p> <p>Because I'm accessing the data using <code>ng-repeat</code> and <code>{{ActivityDate||date:"dd/MM/yyyy"}}</code> to make it show on the view, I cannot convert it do a date object manually using <code>new Date()</code>.</p> <p>I have tried adding new date to the json produced as such but it does not work:</p> <p><code>$outp .= '"ActivityDate": new Date("'. $rs["ActivityDate"] . '"),';</code></p> <p>What is the right way to do it?</p>