Angular5 + DotnetCore 2.1 - How to convert dateTime?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


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 ?





Did u try this from your api serverDate.ToString("yyyy-MM-dd");
– ershoaib
40 secs ago




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.

Popular posts from this blog

Visual Studio Code: How to configure includePath for better IntelliSense results

Spring cloud config client Could not locate PropertySource

Regex - How to capture all iterations of a repeating pattern?