Tuesday, April 10, 2018

Question about parsing DateTime in asp.net core

I take a serialized DateTime string value like: 2018-04-10T00:57:04+02:00 and send it back to the server as a GET argument via

[FromQuery]DateTime offset 

however this fails to parse correctly as offset will then be set to {1/1/01 12:00:00 AM}

If I remove the timezone offset and just send 2018-04-10T00:57:04 then it will parse correctly. What is the preferred way to parse that date? As said I get this value straight from the server and just send it back, parse it to same type, so it should work?

Question about parsing DateTime in asp.net core Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team