Microsoft DateTime Sync Script

I have a problem with DateTime data synchronization. When DateTime data is synchronized, it always uses the local time zone of the servers. I searched and read about it and only found this official workaround:

http://support.microsoft.com/kb/842545

This workaround was published back in 2007. Is it true that Microsoft has not released a fix for this problem? If not, is this the only workaround to solve the problem?

+4
source share
1 answer

If you have control over the client and server, it is always preferable to work with UTC DateTimes (independent of the time zone). Then you should always save to the database (or to the file or any save you use) DateTimes with DateTimeKind UTC:

http://msdn.microsoft.com/en-us/library/system.datetime.kind.aspx

You can delegate the correct time display to the client (given the time zone of users).

If you do not have control over the client and server, I do not see a workaround, but a Microsoft workaround. The fact is that UTC should always be used when potentially encountering clients in different time zones.

Regards, Torgeir

0
source

All Articles