问题
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
- Hawaii Time
- Alaska Time
- Pacific Time
- Mountain Time
- Central Time
- 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