WCF RIA Serviceshttp://forums.silverlight.net//53.aspx/1?WCF+RIA+ServicesA forum for discussing the client and server pieces that make up the WCF RIA Services framework for SilverlightMon, 01 Jan 0001 00:00:00 -050053202590http://forums.silverlight.net//p/87574/202590.aspx/1?Date+are+covnerted+to+UTC+dates+automaticallyDate are covnerted to UTC dates automatically <p>&nbsp;The dates are automatically converted into UTC dates at client side when I do querying. Is there a way to turn off this behaviour? <br> </p> <p>&nbsp;<br> </p> 2009-04-07T09:40:38-04:00202846http://forums.silverlight.net//p/87574/202846.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>You can override UseUtcDateTimes in your DomainService and return false.</p> 2009-04-07T19:00:20-04:00203070http://forums.silverlight.net//p/87574/203070.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>&nbsp;Actually, the UseUtcDateTimes is already return false, but somehow the dates still get converted to UTC dates at client side.<br> </p> 2009-04-08T07:07:21-04:00203510http://forums.silverlight.net//p/87574/203510.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>What kind of DateTimes are you returning from the server (check DateTime.Kind)? Unspecified, Local or Utc? Unless they're local, I believe the serializer will assume the dates are UTC.</p> 2009-04-08T19:11:51-04:00203628http://forums.silverlight.net//p/87574/203628.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>As Wilco said,&nbsp;the client DataContractJsonSerializer and server JavaScriptJsonSerializers we're using send UTC over the wire. Therefore, you'll always recieve UTC on the client, and if you want to display Local times, you'll have to do that conversion yourself - our client components do no conversions.</p> <p>Details on DomainService.UsesUtcDateTimes: Our LinqToEntities and LinqToSql domain services override the base implementation (which returns true), both returning false, since that is the behavior we deemed most common. This means that the LTS/LTE domain services are doing conversions&nbsp;to Local time.&nbsp;You can override this&nbsp;property and return true if you're storing UTC times in your DB and you don't want any conversions. If you override and set UsesUtcDateTimes = true, our serializer won't perform any conversions to the time read from the datasource.</p> 2009-04-08T23:47:01-04:00203705http://forums.silverlight.net//p/87574/203705.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>Changing DateTime.Kind value at server and client side does not have any effect. </p> <p>And also, changing UsesUtcDateTimes at domain service to true / false has no effect, too.</p> <p>The solution I am using now is to add back the missing hours using IValueConverter.<br> </p> 2009-04-09T03:29:29-04:00204059http://forums.silverlight.net//p/87574/204059.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>I assume on the client you're using the correct DateTime.ToLocal/ToUniversalTime methods for the conversions? If you're storing Local times in your datasoruce, they will be converted to UTC on the wire but doing a ToLocal on them client side&nbsp;should get you your original local time.</p> 2009-04-09T16:24:54-04:00207991http://forums.silverlight.net//p/87574/207991.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>i have the same problem, could somebody please tell me where i can set UsesUtcDateTimes = true so that no conversion will be done?<br> <br> thanks!</p> 2009-04-17T12:03:39-04:00207993http://forums.silverlight.net//p/87574/207993.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>&nbsp;UsesUtcDateTimes is a overridable readonly-property in DomainService class. You can override it and return true. But as I mentioned in earlier posting, it does not work. It is the problem of JSON serialization itself. So, I have to use IValueConverter at client side.<br> </p> 2009-04-17T12:32:45-04:00208000http://forums.silverlight.net//p/87574/208000.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>thanks for your reply!<br> <br> So you don't use DateTime.ToLocal or something like that, instead you add the hours directly to the DateTime Values?<br> <br> Thank you!</p> 2009-04-17T12:51:06-04:00208009http://forums.silverlight.net//p/87574/208009.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>&nbsp;You can use DateTime.ToLocal if you want to convert to the local time at client side. For my case, I want to show the local time at server side, hence I use AddHour. Normally, I prefer AddHour because some user PCs have wrong regional settings. <br> </p> 2009-04-17T13:18:06-04:00213471http://forums.silverlight.net//p/87574/213471.aspx/1?Re+Date+are+covnerted+to+UTC+dates+automaticallyRe: Date are covnerted to UTC dates automatically <p>Could be my issue, sorry. </p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> 2009-04-29T09:46:11-04:00