Use this simple VB.NET code to return the name of the month from an integer.
Example: 1 = January ….. 12 = December

Private Function GetMonthName(ByVal monthNum As Integer) As String  Try  Dim strDate As New DateTime(1, monthNum, 1)  Return strDate.ToString("MMM")  Catch ex As Exception  End Try  End Function
Tagged with:  
  • I Halligan

    Easier to use:–

    Dim xMonth As String = MonthName(MonthNum)

    MonthName is a builtIn function to VB.net

    • http://www.mikesel.info/ Mike Hudson

      Thanks for that suggestion. :)

  • Pingback: URL


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!