I am sending date from asp.net web api like this:
SubmitDate.ToString()
and it is returning:
12/13/2018 8:24:20 AM
in angular component and I'm using angular pipe to show date in "December 12, 2018" format, It is working fine with my current PC date format but when I change date format of my PC, It gives me error as shown below
'Unable to convert "18/12/13 1:54:20 PM" into a date' for pipe 'DatePipe'
Please help to understand it and I have tried these ways
SubmitDate.ToLocalTime().ToString()
SubmitDate.ToUniversalTime().ToString()
but with no success. How to pass and process date from web api to angular component?
With angular pipe:
solution.SubmitDate | date:'MMMM d, yyyy'