Angular5 + DotnetCore 2.1 - How to convert dateTime?

Multi tool use


Angular5 + DotnetCore 2.1 - How to convert dateTime?
I have a problem handling date in angular, I got a datetime from server (using ASP.NET Core 2.1) like : "2018-07-29T06:31:41.57547" but actually I just need the date only without time like "2018-07-29". This caused my wont show the date in my form.
Should I use AutoMapper to map all datetime to string first or could I just convert to date in my angular ? or any other solutions ?
1 Answer
1
Just convert it in Angular using DatePipe
https://angular.io/api/common/DatePipe
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Did u try this from your api serverDate.ToString("yyyy-MM-dd");
– ershoaib
40 secs ago