Function to return Month Name based on month number.

Virendradugar
Posted by Virendradugar under VB.NET category on | Views : 2427
Public Shared Function GetMonthName(ByVal iMonth As Integer) As String
Dim strMonthName As String = String.Empty
Select Case (iMonth)
Case 1
strMonthName = "January"
Case 2
strMonthName = "February"
Case 3
strMonthName = "March"
Case 4
strMonthName = "April"
Case 5
strMonthName = "May"
Case 6
strMonthName = "June"
Case 7
strMonthName = "July"
Case 8
strMonthName = "August"
Case 9
strMonthName = "September"
Case 10
strMonthName = "October"
Case 11
strMonthName = "November"
Case 12
strMonthName = "December"
Case Else
strMonthName = "Unknown Month"
End Select
Return strMonthName
End Function

Comments or Responses

Login to post response