关于日期时间............................... [英] regarding Date time...............................
本文介绍了关于日期时间...............................的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是夏时制,以及如何在c#中进行管理
如果我的问题令专家和读者感到失望,那么对此感到抱歉,但对我而言,代码项目仅是我可以得到真实和概念性答案的地方.
What is day light saving and how does it managed in c#
if my Question is disappointment any of Expert and reader then sorry for that but for me code project is only place where i can get real and conceptual answer.
推荐答案
夏令时 [ ^ ]
Daylight saving time[^]
using System;
class Program
{
static void Main()
{
DateTime d = new DateTime(2010, 1, 1);
TimeZone cur = TimeZone.CurrentTimeZone;
bool flag = !cur.IsDaylightSavingTime(d);
for (int i = 0; i < 365; i++)
{
bool f = cur.IsDaylightSavingTime(d);
if (f != flag)
{
Console.WriteLine("{0}: begin {1}", d, f);
flag = f;
}
d = d.AddDays(1);
}
}
}
从以下代码引用的代码:夏时制 [ http://msdn.microsoft.com/en-us /library/system.timezone.isdaylightsavingtime(v=vs.110).aspx [
code referenced from: Daylight saving time[^]
http://msdn.microsoft.com/en-us/library/system.timezone.isdaylightsavingtime(v=vs.110).aspx[^]
这篇关于关于日期时间...............................的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文