Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
Issue with C# Web API 2 Date format in JSON

I am working on a large system that is using C# Web API 2 and Angular 12 on the front-end. Dates that are coming in via Oracle to C# are true dates in both systems (not strings).

They come across in the format "2021-11-10T10:48:38", which is showing typeof() as string into Angular even though we have these in TypeScript as Date in the interface.

When any JS date operations are attempted on these date objects, they fail, although the front-end compiler doesn't catch them because it assumes they are Date types due to the interface. So it fails at run-time.

What is the best way to handle this on the C# side? I can do ourDate = new Date(ourDate) on the Angular side, which does work, but is not reasonable to do this everywhere we call the API.

I apologize for all the tags but I'm not sure where I should attack this from, I assume in the JSON serialization step on the server.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!