MyMonthName

Returns the month name in one of 5 formats (below)
It can use full date or only the month number
1: Returns full English month name, March
2: Returns short English, Mar
3: Arabic month name full, تشرين الثاني
4: فبراير
5: ت2
Renamed to MyMonthName to avoid conflict with MonthName built in function


Public

Tested

My Own Work
Function MyMonthName(DateSe , En1En2Ar3Ar4Ar5)
 MyMonthName    = MyMonthName1(Month(DateSe), En1En2Ar3Ar4Ar5)
End Function
Function MyMonthName1(MonthID , En1En2Ar3Ar4Ar5)
 If En1En2Ar3Ar4Ar5 = 1 Then
  Select case MonthID
  Case 1: Rett  = "January"
  Case 2: Rett  = "February"
  Case 3: Rett  = "March"
  Case 4: Rett  = "April"
  Case 5: Rett  = "May"
  Case 6: Rett  = "June"
  Case 7: Rett  = "July"
  Case 8: Rett  = "August"
  Case 9: Rett  = "September"
  Case 10: Rett  = "October"
  Case 11: Rett  = "November"
  Case 12: Rett  = "December"
  End Select
 ElseIf En1En2Ar3Ar4Ar5 = 2 Then
  Select case MonthID
  Case 1: Rett  = "Jan"
  Case 2: Rett  = "Feb"
  Case 3: Rett  = "Mar"
  Case 4: Rett  = "Apr"
  Case 5: Rett  = "May"
  Case 6: Rett  = "Jun"
  Case 7: Rett  = "Jul"
  Case 8: Rett  = "Aug"
  Case 9: Rett  = "Sep"
  Case 10: Rett  = "Oct"
  Case 11: Rett  = "Nov"
  Case 12: Rett  = "Dec"
  End Select
 ElseIf En1En2Ar3Ar4Ar5 = 3 Then
  Select case MonthID
  Case 1: Rett  ="كانون الثاني"
  Case 2: Rett  ="شباط"
  Case 3: Rett  ="آذار"
  Case 4: Rett  ="نيسان"
  Case 5: Rett  ="أيار"
  Case 6: Rett  ="حزيران"
  Case 7: Rett  ="تموز"
  Case 8: Rett  ="آب"
  Case 9: Rett  ="أيلول"
  Case 10: Rett  ="تشرين الأول"
  Case 11: Rett  ="تشرين الثاني"
  Case 12: Rett  ="كانون الأول"
  End Select
 ElseIf En1En2Ar3Ar4Ar5 = 4 Then
  Select case MonthID
  Case 1: Rett  ="يناير"
  Case 2: Rett  ="فبراير"
  Case 3: Rett  ="مارس"
  Case 4: Rett  ="أبريل"
  Case 5: Rett  ="مايو"
  Case 6: Rett  ="يونيو"
  Case 7: Rett  ="يوليو"
  Case 8: Rett  ="اغسطس"
  Case 9: Rett  ="سبتمبر"
  Case 10: Rett  ="أكتوبر"
  Case 11: Rett  ="نوفمبر"
  Case 12: Rett  ="ديسمبر"
  End Select
 ElseIf En1En2Ar3Ar4Ar5 = 5 Then
  Select case MonthID
  Case 1: Rett  ="ك2"
  Case 2: Rett  ="شب"
  Case 3: Rett  ="ذار"
  Case 4: Rett  ="نيس"
  Case 5: Rett  ="يار"
  Case 6: Rett  ="حز"
  Case 7: Rett  ="تم"
  Case 8: Rett  ="آب"
  Case 9: Rett  ="أي"
  Case 10: Rett  ="ت1"
  Case 11: Rett  ="ت2"
  Case 12: Rett  ="ك1"
  End Select
 End If
 MyMonthName1   = Rett
End Function

DateSe, En1EN2Ar3Ar4Ar5
or
MonthID , En1En2Ar3Ar4Ar5

Views 4475 Downloads 1137

Classic ASP Date+Time
ANmarAmdeen
655
Revisions

v3.0