C# Synchronizing different time zones

荒凉一梦 提交于 2020-01-05 05:28:12

问题


I have an application on a server which is UK based.

Say I needed the application to run at the same time for different countries. For arguments sake say I needed it to send an email to a mailbox whenever the time is 7pm in various countries.

How would I be able to achieve this? At the moment I just have it running from the Task Scheduler at the specific time (which is fine for UK based clients). However, I would like to support internationally.

Thanks.


回答1:


Store date/times as UTC, and then compute time for each locations's time zone.

Plesae see: C# - Convert UTC/GMT time to local time



来源:https://stackoverflow.com/questions/1987824/c-sharp-synchronizing-different-time-zones

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!