1

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.

James
  • 80,725
  • 18
  • 167
  • 237

1 Answers1

3

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

Community
  • 1
  • 1
Mitch Wheat
  • 295,962
  • 43
  • 465
  • 541
  • 1
    It's the second part that's the hard bit. Noda Time is not quite ready yet but soon it will be a good solution for time zone calculations in .NET: http://code.google.com/p/noda-time/ – Tamas Czinege Jan 01 '10 at 04:38
  • Ok so when storing the DateTime (when using the system DateTime) I should always use UTC. However, from my example where I am just using Task Scheduler and running the application at 7pm, how would I work out when it is 7pm in different countries for it to trigger? – James Jan 01 '10 at 19:15
  • This is pretty much what I had to do. – James Apr 05 '10 at 18:58