Is there any way to prevent Silverlight/RIA Services from converting a datetime object on the wire?
Right now, I see datetimes set to 'Local' or 'Unspecified' being converted to the local time of the server when they are sent over the wire.
For example:
The client and server are both in UTC -04:00:00.
Great. Now I change my client to be in UTC +12:00:00
So it is apparent that the serializer is converting to the local time of the server, which I do not want. The value I want in the DB is 24/08/2010 00:00:00.
Using UTC is not a great option for this field as the database is part of our legacy application and the column contains invariant dates at this time. I don't want to start inserting UTC datetimes alongside the existing data.
Any ideas?
Thanks in advance
If I create the DateTime like this, it works:
new DateTime(DateTime.Now.Ticks, DateTimeKind.Unspecified).Date;