I am getting date from backend which contains 'T' literal init.
'2017-02-20T15:30:44'
Can you help me how to format this in angular 2.
I am getting date from backend which contains 'T' literal init.
'2017-02-20T15:30:44'
Can you help me how to format this in angular 2.
There is nothing related to angular2 with date format you can simply do this using pure javascript like this
new Date('2017-02-20T15:30:44')).toLocaleString()
You can format in HTML as well as in typescript.
In .ts file:
let dateString = '1968-11-16T00:00:00'
let newDate = new Date(dateString);
In HTML:
{{dateString | date:'MM/dd/yyyy'}}