Function BirthdayToAge(BirthDate)
''函数功能:由出生日期返回岁龄
''入口参数:出生日期
''函数返回:出错或非正常返回为 vbnullstring,否则为岁龄的字符串
'' <1个月 为 几天
'' <1岁为 几月零几天
'' <6岁为 几岁零几月
''edit by dflzzp
Dim myYear
Dim myMonth
Dim myDay
Dim CurDate
CurDate = Date()
If Not IsDate(BirthDate) Then
else
End If
If DateDiff("d",BirthDate,CurDate)<=0 Then
BirthdayToAge = ""
Exit Function
End If
diffday=day(BirthDate)-day(CurDate)
diffmonth=DateDiff("m",BirthDate,CurDate)
diffyear=int(diffmonth/12)
diffmonth0=diffmonth mod 12
if(diffday<0) then
elseif(diffday=0) then
else
end if
End Function
response.Write(BirthdayToAge("2008-6-1"))
response.Write(BirthdayToAge("2008/6/1"))
response.Write(BirthdayToAge(#2008/6/1#))
response.Write(BirthdayToAge(#6/1/2008#))