Find UTC Time for ALL USA TimeZone for below Times using C#.net

回眸只為那壹抹淺笑 提交于 2019-12-24 19:32:01

问题


How can i find UTC time for all these TimeZone for all these hours

  • 8 Am (in UTC for all USA Time Zones)
  • 5 PM (in UTC for all USA Time Zones)
  • 10 PM (in UTC for all USA Time Zones)

USA Time Zones

  1. Hawaii Time
  2. Alaska Time
  3. Pacific Time
  4. Mountain Time
  5. Central Time
  6. Eastern Time

I need to find it using C#.net

More Details:
For all who are curious what am I doing with these times.
I have to run a scheduled job at these times
8AM, 5PM and 10PM every day
And this time should be user local time.
So if I find all UTC time for 6 zones
I though I can run my scheduled job at all those UTC times.
That will be 6 zones x 3 times(8,5,10) = 18 times I will run my batch
Hope this approach make sense to you.

Thanks


回答1:


For help converting between time zones, check out this article. http://www.danrigsby.com/blog/index.php/2008/08/24/timezone-vs-timezoneinfo-in-net/

If you just want to check if right now is a certain time in utc

DateTime.UtcNow.Hour will probably be pretty helpful.



来源:https://stackoverflow.com/questions/11677813/find-utc-time-for-all-usa-timezone-for-below-times-using-c-net

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