title: How to strip timezone from DateTime in .NET Core
body: <p>I have a use case that I'm not sure how to solve in a nice way.
  I'm currently developing a <em>.Net</em> Core <em>WebApi</em> that is receiving data from various current systems, from a cross the whole world. Which I then process and lastly I commit it to <em>SAP</em> through oData endpoint.</p>
  <p>The problem I'm having is on of parameters I'm receiving in the body payload, is a <code>DateTime</code>. Previous I have not have any issues. But not long ago I started getting data from a other system which deliverers it in a slightly differently way.</p>
  <p>Previously this was the format I got: <code>2020-09-16T16:30:00</code> not problem with it. But the new system looks like this: <code>2020-09-16T16:00:00 -05:00</code> Could also end in <code>+08:00</code>.</p>
  <p>The problem I'm facing is that <em>SAP</em> needs to get in <em>local time</em>. But in the my code it converts this: <code>2020-09-16T16:00:00 -05:00</code> to <code>2020-09-16T23:00:00</code> when I see the incoming payload in the controller.</p>
  <ul>
  <li><p>I have searched quite a bit to find a solution. But 99% only suggest using <em>UTC time</em>, which is not a option for me.</p>
  </li>
  <li><p>Another option is to use <code>DateTimeOffset</code>, which I have tried but can't the time conversion to use <em>localTime</em>.</p>
  </li>
  </ul>
  <p>My question is. Are it not possible to custom convert to strip the <em>timezone</em> before it hits the controller?</p>