Overview : 11JAN와 같은 날짜 형식을 오늘과 비교해서, 이전 날짜인 경우 False 로 리턴되는 함수
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
<% Function ConvertToKoreanDate(dateStr) ' Korean month names mapping Dim months months = Split("JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC", ",") ' Extract day and month from the input Dim day, monthStr, month, year day = Left(dateStr, 2) monthStr = UCase(Mid(dateStr, 3)) ' Find the month number Dim i month = 0 For i = 0 To UBound(months) If monthStr = months(i) Then month = i + 1 Exit For End If Next ' Current year 'year="2024" year = Left(Date(),4) ' Return the Korean formatted date ConvertToKoreanDate = DateSerial(year, month, day) End Function Function IsDateBeforeToday(dateStr) Dim inputDate inputDate = ConvertToKoreanDate(dateStr) ' Compare with current date If inputDate >= Date() Then IsDateBeforeToday = True Else IsDateBeforeToday = False End If End Function ' Example usage Dim result result = IsDateBeforeToday("09DEC") ' Adjust the date as needed Response.Write(result) %> |