How reliable is DateTime.UtcNow in Silverlight applications?

I have a silverlight application , whose users will work in different time zones .

These applications download their data from the server at startup, and then cache in the Isolate storage .

When I make changes to the data on the server, I want to be able to change the " last updated time " so that all silverlight clients download the latest data the next time that date is checked.

However, I'm a little confused about how to handle the time zone problem, since if the server is in New York and the update time is set to 2010-01-01 17:00:00 and the client in the Seattle check compares it with the local time of 2010-01 -01 14:00:00 he will not update and will continue to provide old data for another three hours.

My solution is to always send the update time at UTC , not the time on the server, and then make the Silverlight application check with DateTime.UtcNow .

It is as simple as it seems, or their problems with it, for example. that time zones are not set correctly on computers, and therefore SilverlightApp does not report the correct UTC time. Can anyone tell from experience how likely it is that using DateTime.UtcNow, like this to update the cache, will work in all cases?

If DateTime.UtcNow is not reliable, I just use the added "DataVersion" integer , but there are other scenarios in which fast time zone synchronization would make it useful to understand how this can be solved in silverlight applications.

+3
source share
1

DateTime.UtcNow , . , Silverlight .NET, , ?

, , . .

, , . , FUD, .

+2

Source: https://habr.com/ru/post/1741403/


All Articles