C# TimeZone GetDaylightChanges
Description
TimeZone GetDaylightChanges
returns the daylight saving
time period for a particular year.
Syntax
TimeZone.GetDaylightChanges
has the following syntax.
public abstract DaylightTime GetDaylightChanges(
int year
)
Parameters
TimeZone.GetDaylightChanges
has the following parameters.
year
- The year that the daylight saving time period applies to.
Returns
TimeZone.GetDaylightChanges
method returns A System.Globalization.DaylightTime object that contains the start and
end date for daylight saving time in year.
Example
using System;//from ww w. ja v a 2 s . c om
using System.Globalization;
class TimeZoneDemo
{
static void Main( )
{
// Get the local time zone and the current local time and year.
TimeZone localZone = TimeZone.CurrentTimeZone;
Console.WriteLine(localZone.GetDaylightChanges(2014) );
}
}
The code above generates the following result.