UTC在几分钟内偏移 [英] UTC offset in minutes
本文介绍了UTC在几分钟内偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎样才能得到分钟本地时间和UTC时间之间的差异(在C#)。
How can I get the difference between local time and UTC time in Minutes (in C#).
感谢。
推荐答案
使用<一个href="http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx"><$c$c>TimeZoneInfo$c$c>:
TimeSpan delta = TimeZoneInfo.Local.GetUtcOffset();
double utcMinuteOffset = delta.TotalMinutes;
这篇关于UTC在几分钟内偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文