日期:2010-11-04  浏览次数:20875 次

'根据身份证获取出生年月日
Function GetBirthday(str)
Dim dt
if len(str) = 15 then
'注意:需要区分2000年出生的、2000年后出生的
dt = DateSerial("19" & Mid(str,7,2),Mid(str,9,2),Mid(str,11,2))
elseif len(str) = 18 then
dt = DateSerial(Mid(str,7,4), Mid(str, 11, 2), Mid(str, 13, 2))
else
dt = CDate("1900-01-01")
end if
GetBirthday = dt
End Function