当前位置: 代码迷 >> ASP >> 怎么草时间字段里面截取需要的内容
  详细解决方案

怎么草时间字段里面截取需要的内容

热度:68   发布时间:2012-03-09 16:54:57.0
如何草时间字段里面截取需要的内容。
比如我有一个时间字段rs( "time ")里面的格式是2007-5-22
现在我想只截取   月和日期显示不显示年份,可以用month(rs( "time "))& "- "&day(rs( "time "))

这样可以实现,但我想用一个函数就截取出来   因该怎么截取

------解决方案--------------------
Function GetMD(datDate)
if datDate= " " or isDate(datDate)=false then
GetMD = Month(Now) & "- " & Day(Now) '可以自己设置某个日期
Exit function
end if

GetMD = Month(datDate) & "- " & Day(datDate)
End function
  相关解决方案