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、jager lambda crop mannered clapper plinth Morton silvery Atlantis societal
2、JIR中文翻译,JIR是什么意思,JIR发音、用法及例句
3、produces中文翻译,produces是什么意思,produces发音、用法及例句
4、shive中文翻译,shive是什么意思,shive发音、用法及例句
5、0n(o n中文翻译,o n是什么意思,o n发音、用法及例句)
7、俗[ sú ],俗字的拼音,部首,意思,组词,成语,俗字的笔顺,笔画顺序怎么写
8、隴[ lǒng ],隴字的拼音,部首,意思,隴字的笔顺,笔画顺序怎么写
9、cultch是什么意思,cultch中文翻译,cultch怎么读、发音、用法及例句
10、haematoid是什么意思,haematoid中文翻译,haematoid怎么读、发音、用法及例句
11、unspeakableness是什么意思,unspeakableness中文翻译,unspeakableness怎么读、发音、用法及例句
版权声明: 本站仅提供信息存储空间服务,旨在传递更多信息,不拥有所有权,不承担相关法律责任,不代表本网赞同其观点和对其真实性负责。如因作品内容、版权和其它问题需要同本网联系的,请发送邮件至 举报,一经查实,本站将立刻删除。











