使用 C#.net 查找以下时间的所有美国时区的 UTC 时间 [英] Find UTC Time for ALL USA TimeZone for below Times using C#.net
问题描述
如何找到所有这些时区的 UTC 时间
How can i find UTC time for all these TimeZone for all these hours
- 上午 8 点(所有美国时区的 UTC 时间)
- 下午 5 点(所有美国时区的 UTC 时间)
- 晚上 10 点(所有美国时区的 UTC 时间)
美国时区
- 夏威夷时间
- 阿拉斯加时间
- 太平洋时间
- 山区时间
- 中部时间
- 东部时间
我需要使用 C#.net 找到它
I need to find it using C#.net
更多详情:
对于所有好奇我这些时间在做什么的人.
我必须在这些时间运行预定的作业
每天早上 8 点、下午 5 点和晚上 10 点
而这个时间应该是用户当地时间.
因此,如果我找到 6 个区域的所有 UTC 时间
我虽然可以在所有这些 UTC 时间运行我的预定作业.
那将是 6 个区域 x 3 次(8,5,10)= 18 次我将运行我的批次
希望这种方法对您有意义.
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.
谢谢
推荐答案
有关在时区之间转换的帮助,请查看这篇文章.http://www.danrigsby.com/blog/index.php/2008/08/24/timezone-vs-timezoneinfo-in-net/
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/
如果您只想检查现在是否是 UTC 中的某个时间
If you just want to check if right now is a certain time in utc
DateTime.UtcNow.Hour
可能会很有帮助.
这篇关于使用 C#.net 查找以下时间的所有美国时区的 UTC 时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!