I have a web service (actually a silverlight enable wcf service, but for all intents and purposes, it’s a web service) with a method taking a datetime parameter. The method gets called from a client, which could be in a different time zone. The service hosting the web service is in pacific standard time, and it appears the web service is converting the date time value to the servers time zone. The intent of the web service is to compare the datetime value against a value in the database, but the value in the database is based on the clients timezone, so because of the conversion, the comparison is not working.
Is there any way to turn the conversion off?
I’m trying to make sure I have this correct: your web service method takes a parameter of type DateTime (as in, System.DateTime) and is converting the passed parameter?
DateTime objects don’t carry an implicit timezone, so any determination by the web service to infer local time would be a logic flaw (at least without supporting timezone criteria.)
If you can supply your server and client code snippets, it would make the scenario easier to diagnose.
UPDATE: Not sure if this scenario is accurate, so please clarify:
If this is the case, can you convert all data to UTC time? If you’re executing a query lookup, this implies converting the stored data to UTC as well.