Display the daylight saving time range for the current year
Imports System
Imports System.Globalization
Imports Microsoft.VisualBasic
Module TimeZoneDemo
Sub Main( )
Dim localZone As TimeZone = TimeZone.CurrentTimeZone
Dim currentDate As DateTime = DateTime.Now
Dim currentYear As Integer = currentDate.Year
Dim daylight As DaylightTime = localZone.GetDaylightChanges( currentYear )
Console.WriteLine( "Daylight saving time for year {0}:", currentYear )
Console.WriteLine( "{0:yyyy-MM-dd HH:mm} to {1:yyyy-MM-dd HH:mm}, delta: {2}", daylight.Start, daylight.End, daylight.Delta )
End Sub
End Module
Related examples in the same category