birthdate是什么意思,birthdate中文翻译,birthdate发音、用法及例句

•birthdate
birthdate发音
英:['bɜ:θdeɪt] 美:['bɜ:θdeɪt]
英: 美:
birthdate中文意思翻译
n. 出生年月日
ASP里知道生日如何计算年龄(年月日)
发错地方了!
随便在一个地方调用一下 BirthdayToAge函数,输出就可以了!很简单的!
ASP里知道生日如何计算年龄(年月日)
ASP生日计算年龄 修正版 v1.2 by dflzzp
8-10 17:10
<%
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
BirthdayToAge = vbNullString
Exit Function
else
myYear=year(BirthDate)
myMonth=month(BirthDate)
myDay=day(BirthDate)
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
if(diffyear>=1) then
BirthdayToAge = diffyear&"岁"&diffmonth0&"月"&abs(diffday)&"天"
elseif(diffmonth>=1) then
BirthdayToAge = diffmonth0&"月"&abs(diffday)&"天"
else
BirthdayToAge = abs(diffday)&"天"
end if
elseif(diffday=0) then
if(diffyear>=1) then
BirthdayToAge = diffyear&"岁"&diffmonth0&"月整"
else
BirthdayToAge = diffmonth0&"月整"
end if
else
diffmonth=diffmonth-1
diffyear=int(diffmonth/12)
diffmonth0=diffmonth mod 12
diffday=DateDiff("d",year(now)&"-"&(month(now)-1)&"-"&day(BirthDate),year(now)&"-"&month(now)&"-"&day(now))
if(diffyear>=1) then
BirthdayToAge = diffyear&"岁"&diffmonth0&"月"&diffday&"天"
elseif(diffmonth>=1) then
BirthdayToAge = diffmonth0&"月"&diffday&"天"
else
BirthdayToAge = diffday&"天"
end if
end if
End Function
%>
使用方法很简单,说白了就是对函数的引用,但要熟悉ASP中时间的表示方法:
response.Write(BirthdayToAge("2008-6-1")
response.Write(BirthdayToAge("2008/6/1")
response.Write(BirthdayToAge(#2008/6/1#)
response.Write(BirthdayToAge(#6/1/2008#))
以上几种都行!
本站其他内容推荐
1、narrow limpid optimal sacristan highland bemused petting Christianism autarky straiten
2、Helsingborg中文翻译,Helsingborg是什么意思,Helsingborg发音、用法及例句
3、Balen中文翻译,Balen是什么意思,Balen发音、用法及例句
4、connect failed中文翻译,connect failed是什么意思,connect failed发音、用法及例句
6、fure缩写是什么意思,fure的全称及含义,fure全称意思大全
7、virgin什么意思,virgin是什么意思,virgin中文翻译,virgin发音、用法及例句
8、indiscretion是什么意思,indiscretion中文翻译,indiscretion发音、用法及例句
9、塃[ huāng ],塃字的拼音,部首,繁体,塃字的意思
版权声明: 本站仅提供信息存储空间服务,旨在传递更多信息,不拥有所有权,不承担相关法律责任,不代表本网赞同其观点和对其真实性负责。如因作品内容、版权和其它问题需要同本网联系的,请发送邮件至 举报,一经查实,本站将立刻删除。











