How do I get a date in Silverlight?

from the title seems like a silly question :) I know, but I have a silverlight application that needs to send datetime to 3rdparty web method and based on datetime fill some client side controls ... now I know how to get datetime from client. but the problem is that the client's time might be wrong ........ one method is to use a webservice to get any other idea in the future?

0


a source to share


2 answers


If you want server time reliability, then yes - a web service will suffice. I recently came across a Silverlight limitation that would only allow a web service (WCF or otherwise). I chose a regular .NET webservice for my scenario and when all was said and done it worked like a charm.



+2


a source


More specifically about your scenario. What do you mean by "client time"?



If you mean that the client time may differ from the server time due to a world time difference (for example, a client that is accessed from the US while the server is in the UK), you need to make sure you convert your time in Universal Time , calling DateTime.ToUniversalTime()

before sending.

+1


a source







All Articles