title: Override DateTime serialization for ASP.NET WebMethod parameters
body: <p>I am working on cleaning up a bug in a large code base where no one was paying attention to local time vs. UTC time.  </p>
  
  <p>What we want is a way of globally ignoring time zone information on DateTime objects sent to and from our ASP.NET web services.  I've got a solution for retrieve operations.  Data is only returned in datasets, and I can look for DateTime columns and set the DateTimeMode to Unspecified.  That solves my problem for all data passed back and forth inside a data set.</p>
  
  <p>However DateTime objects are also often passed directly as parameters to the web methods.  I'd like to strip off any incoming time zone information.  Rather than searching through our client code and using DateTime.SpecifyKind(..) to set all DateTime vars to Undefined, I'd like to do some sort of global ASP.NET override to monitor incoming parameters and strip out the time zone information.</p>
  
  <p>Is such a thing possible?  Or is there another easier way to do what I want to do?</p>
  
  <p>Just to reiterate -- I don't care about time zones, everyone is in the same time zone.  But a couple of users have machines badly configured, wrong time zones, etc.  So when they send in July 1, 2008, I'm getting June 30, 2008 22:00:00 on the server side where it's automatically converting it from their local time to the server's local time.</p>
  
  <p><strong>Update:</strong> One other possibility would be if it were possible to make a change on the client side .NET code to alter the way DateTime objects with Kind 'Undefined' are serialized.</p>