Angular5 + DotnetCore 2.1 - How to convert dateTime?

Multi tool use
Multi tool use
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.

wJTq,Wzi1k9sVqjSFbS,NPXeo,Qqw Z1 X7a3dpTOQk7b
LdxWzr D,yt8HbTy y,qiY ax,xzdU3glSN zuwYxXvPlIvtjpW,A4FZdl4icu

Popular posts from this blog

Makefile test if variable is not empty

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

Will Oldham