Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.05 KB | None | 0 0
  1. Function MakeOrchardDateNotStupid (ByVal strDate As String) As String
  2.     return DateTime.ParseExact ("dd-MMM-yyyy", strDate).ToString ("dd/mm/yyyy")
  3. End Function
  4.  
  5.  Function MakeOrchardDate(ByVal strDate As String) As String
  6.  
  7.     Dim strMonth As String
  8.  
  9.     'input strDate format dd-mmmm-yyyy
  10.     ' output format
  11.  
  12.     strMonth = UCase(Mid(strDate, 4, 3))
  13.     Select Case strMonth
  14.       Case "JAN"
  15.         strMonth = "01"
  16.       Case "FEB"
  17.         strMonth = "02"
  18.       Case "MAR"
  19.         strMonth = "03"
  20.       Case "APR"
  21.         strMonth = "04"
  22.       Case "MAY"
  23.         strMonth = "05"
  24.       Case "JUN"
  25.         strMonth = "06"
  26.       Case "JUL"
  27.         strMonth = "07"
  28.       Case "AUG"
  29.         strMonth = "08"
  30.       Case "SEP"
  31.         strMonth = "09"
  32.       Case "OCT"
  33.         strMonth = "10"
  34.       Case "NOV"
  35.         strMonth = "11"
  36.       Case "DEC"
  37.         strMonth = "12"
  38.       Case Else
  39.         'strMonth = ""
  40.     End Select
  41.     MakeOrchardDate = Mid(strDate, 1, 2) & "/" & strMonth & "/" & Mid(strDate, 8, 4)
  42.  
  43.  
  44.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement