We have a scheduling application that calls the WCF service to run night tasks. A large number of them include information on the current business date. For business reasons, the planning server is set to GMT, but our service runs on servers installed on NY.
There is a problem; dates are passed to our .NET service with explicit time zone information. Therefore, when the service states that the application starts with the date "2008-11-03 00:00:00 +0: 00", the service interprets this as "2008-11-02 19:00:00 -5: 00" and that's it working with the wrong date.
The behavior of the scheduler is third-party and hard-coded, so we cannot tell the scheduler to omit the time zone offset. We do not always want to convert the date to GMT, because there is a real possibility that our Asian offices will call the same service and we will return to the same problem.
Is there a way to mark a DataContract or even control it low enough to make sure the DateTime Kind is Unspecified? Or is there a way with DateTime to determine what source information was used to create it, and convert it back to the original value at the post-processing stage?
If that helps, right now our contract is pretty simple. Methods take one parameter, which is a class derived from the class below.
[DataContract]
public class BaseTimeSensitiveParameters
{
[DataMember] public DateTime? BusinessDate;
}