I am fetching a date from web service. Here is the code:
<a href="#" id="loadData">Load Data</a>
<script type="text/javascript">
var qry = "http://localhost:2084/WcfDataService1.svc/tb_Programs";
$("#loadData").click(function() {
//alert(1);
$('#status').text("Loading Programs...");
$.getJSON(qry, function (results) {
$.each(results.d, function (i, item){
var line = "<div>" + Date(item.PrgFromDate) + ":" + Date(item.PrgToDate) + "</div>";
$("#games").append(line);
});
$('#status').text("");
});
});
</script>
The output of this is: Thu May 28 2015 16:55:31 GMT+0530 (India Standard Time):Thu May 28 2015 16:55:31 GMT+0530 (India Standard Time)
How can I get just the date in dd/mm/yyyy?