views:

29

answers:

2

Hello Friends i'm facing a very weird problem in sliverlight 4 + RIA Services, or maybe it's not weird and i'm just a newbie anyway i hope someone here can help, the problem is the following i've created a function on the server side inside the domain service this function is very simple and has a line in it that adds the server current date and time to the database (it's an HR application and employees should sign in and out thrue it each from it's own pc )

Emp.TimeOut = system.DateTime.now (C# syntax)

the weird part is that for some users it always adds 3 hours to the current time(exp if he signes out at 5 it shows 8) and for others it works perfectly.

the server and all the stations in the company have exactly the same time settings and the same time zone, and anyway my fucntion is on the server side so it should no be realted to the users time. any ideas why this is happening ? i've bin trying to find out why for days now but with no luck

A: 

You need to use UTC values ... generally everwhere there is serialization involved ... whether to DB or to client. Convert to local time when appropriate for display/human readin (and from in the case of input)

NikhilK
A: 

Thank you Nikhil you are right the problem seemed to be from the datetime diffrent kinds i'm getting sometimes local kind and other times unspesified kind, so i just converted all to String instead of Datetime and it's working just fine, i'll do more studies for the next time i want to use datetime so i know how to handle it better. Thank you very much for your help

Patrick Harb