Weekday Function in VB.NET

How to use the weekday function in VB.NET?

Explanation

WeekDay Function

Weekday Date Function in Visual Basic.net 2008 returns an integer value for the day of the week in the range 1 to 7, with '1' representing Sunday.
Syntax:

Weekday(Date)
Example:

Module Module1
Sub Main()
Console.WriteLine("Day of the Week(1-7)::"
& Weekday(Now))
Console.ReadLine()
End Sub
End Module

In the above example, the day value is displayed using the weekday date function in the range 1-7 based on current date specified using Now.

Visual Basic Tutorial


Ask Questions

Ask Question