ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 获取服务器的当前日期函数,返回的日期格式为"YYYY-MM-DD"(转)

获取服务器的当前日期函数,返回的日期格式为"YYYY-MM-DD"(转)

原创 Linux操作系统 作者:jcszjswkzhou 时间:2019-05-23 16:51:07 0 删除 编辑
本函数用于将获取服务器的当前日期,返回的日期格式为"YYYY-MM-DD"
'---------------------------------------------------------------------------
Function AHshGetServerCurrentDate
Dim strTmp, iYear,iMonth,iDate

iYear = Year(Date)
iMonth = Month(Date)
iDate = Day(Date)

strTmp = CStr(iYear) & "-"
If iMonth < 10 Then
strTmp = strTmp & "0" & Cstr(iMonth) & "-"
Else
strTmp = strTmp & Cstr(iMonth) & "-"
End If
If iDate < 10 Then
strTmp = strTmp & "0" & Cstr(iDate)
Else
strTmp = strTmp & Cstr(iDate)
End If
AHshGetServerCurrentDate = strTmp
End Function


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10294527/viewspace-124737/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-08-29

  • 博文量
    3481
  • 访问量
    3019829