Month Function in VB.NET

What is the use of month function in VB.NET?

Explanation

Month Function

Month Function in Visual Basic.net 2008 returns the month of the year as an integer value in the range of 1-12.
Syntax:

Month(Date)
Example:

Module Module1
Sub Main()
Dim dat As Date
dat = "6/23/2010"
Console.WriteLine("Month value of the given date
is::" & Month(dat))
Console.ReadLine()
End Sub
End Module
Result:

Month value of the given date is:: 6

In the above example, the month for the given date is returned using the Month function.

Visual Basic Tutorial


Ask Questions

Ask Question