I am new to ionic, typescript and angularjs. In regular java parsing long date is easy
Date date = new Date(1915654554);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
String strDate = dateFormat.format(date);
But in Ionic-TypeScript, i tried like this
let date=new Date(1915654554);
alert(date); //shows invalid date
Actually i am getting "PublishingDate": "/Date(1497426961890)/"
from web-api
HTML code :
<p>
{{ getActualDate(notice.PublishingDate) }}
</p>
TypeScript code:
getActualDate(lDate)
{
var d=lDate.substring(6,19);
let date=new Date(d)
return date.getDate() + "/" + (date.getMonth() + 1) + "/" + date. getFullYear();
//shows Nan/Nan/Nan
}
its showing invalid date. any help, suggestions please. Thank you.