Mega Code Archive

 
Categories / VB.Net / Date Time
 

TimeZone GetDaylightChanges returns the daylight saving time period for a particular year

Imports System Imports System.Globalization Imports Microsoft.VisualBasic Module DaylightChangesDemo     Dim localZone As TimeZone = TimeZone.CurrentTimeZone     Sub CreateDaylightTime( year As Integer )                  Dim daylight As DaylightTime = localZone.GetDaylightChanges( year )         Console.WriteLine( "{0,-7}{1,-20:yyyy-MM-dd HH:mm}" & _             "{2,-20:yyyy-MM-dd HH:mm}{3}", year, daylight.Start, daylight.End, daylight.Delta )     End Sub      Sub Main( )         Console.WriteLine( localZone.StandardName )         CreateDaylightTime( 2005 )     End Sub  End Module