A quick post to help establish the numerical designator for a day, and create a International date in the form (DD(designator) MMMM, yyyy).
Code Snippet
- Private Function FormatInternationalDate(ByVal DateToFormat As Date) As String
- Dim NumericalDesignator As String = String.Empty
- Select Case Day(DateToFormat)
- Case Is = 1, 21, 31
- NumericalDesignator = "st"
- Case Is = 2, 22
- NumericalDesignator = "nd"
- Case Is = 3, 23
- NumericalDesignator = "rd"
- Case Else
- NumericalDesignator = "th"
- End Select
- '// Return date as 24th June, 2009
- Return DateToFormat.Day.ToString & NumericalDesignator & Space(1) & DateToFormat.ToString("MMMM, yyyy")
- End Function
No comments:
Post a Comment