Click here to Skip to main content
16,012,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

Daylight saving time[^]

C#
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);
    }
    }
}


code referenced from: Daylight saving time[^]


http://msdn.microsoft.com/en-us/library/system.timezone.isdaylightsavingtime(v=vs.110).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900