Class with all shared Member variables
Imports System.IO
Module Module1
Sub Main()
Console.WriteLine("Today: " & Today.TodayDate)
Console.WriteLine("Day: " & Today.Day)
Console.WriteLine("Month: " & Today.Month)
Console.WriteLine("Year: " & Today.Year)
Console.WriteLine("Day of week: " & Today.NumericDayOfWeek)
Console.WriteLine("Day of week: " & Today.StringDayOfWeek)
End Sub
End Module
Class Today
Public Shared TodayDate As DateTime = Now()
Public Shared Day As Integer = Now.Day()
Public Shared Month As Integer = Now.Month()
Public Shared Year As Integer = Now.Year()
Public Shared NumericDayOfWeek As Integer = Now.DayOfWeek()
Public Shared StringDayOfWeek As String = Now.DayOfWeek.ToString()
End Class
Related examples in the same category