问题
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