ASP时间问题 数据库里是2010-07-29 00:00:00 如何输出变成JUL 29 2010 00:00:00
我的数据库里显示的时间是是2010-07-2900:00:00我需要ASP前台显示变成JUL29201000:00:00如何做到谢谢能帮助我的,继续加分我QQ768780...
我的数据库里显示的时间是是2010-07-29 00:00:00
我需要ASP前台显示变成JUL 29 2010 00:00:00
如何做到谢谢
能帮助我的,继续加分
我QQ768780 展开
我需要ASP前台显示变成JUL 29 2010 00:00:00
如何做到谢谢
能帮助我的,继续加分
我QQ768780 展开
5个回答
展开全部
<%
Function MonthToString(sMonth,sLong) '月份转换英文字符函数
dim MonthData
MonthData = Array("January","February","March","April","May","June","July","August","September","October","November","December") '将月份的英文字符装入一个一维数组
MonthToString = MonthData( sMonth - 1 ) '根据月份去数组中相应元素
If sLong > 0 then MonthToString = Left(MonthToString,sLong) '当参数sLong大于0是取字符的前sLong位
End Function
Function FormatDateTimer(sDate,sMode) '时间转换函数
If sDate = "" or IsNull(sDate) then Exit Function
If sMode >= 0 and sMode <= 4 then '当参数sMode在0到4之间时,集成FormatDateTime函数
FormatDateTimer = FormatDateTime(sDate,sMode)
Elseif sMode = 5 then '从sMode为5开始扩展
FormatDateTimer = MonthToString(Month(sDate),3) & " " & Day(sDate) & " " & Year(sDate) & " " & FormatDateTimer(sDate,3)
'函数返回值为“月份转换为英文字符后取前三位” “日” “年” “小时:分:秒”
End if
End Function
response.Write FormatDateTimer("2010-07-29 00:00:00",5) '输出时间,模式为5
%>
Function MonthToString(sMonth,sLong) '月份转换英文字符函数
dim MonthData
MonthData = Array("January","February","March","April","May","June","July","August","September","October","November","December") '将月份的英文字符装入一个一维数组
MonthToString = MonthData( sMonth - 1 ) '根据月份去数组中相应元素
If sLong > 0 then MonthToString = Left(MonthToString,sLong) '当参数sLong大于0是取字符的前sLong位
End Function
Function FormatDateTimer(sDate,sMode) '时间转换函数
If sDate = "" or IsNull(sDate) then Exit Function
If sMode >= 0 and sMode <= 4 then '当参数sMode在0到4之间时,集成FormatDateTime函数
FormatDateTimer = FormatDateTime(sDate,sMode)
Elseif sMode = 5 then '从sMode为5开始扩展
FormatDateTimer = MonthToString(Month(sDate),3) & " " & Day(sDate) & " " & Year(sDate) & " " & FormatDateTimer(sDate,3)
'函数返回值为“月份转换为英文字符后取前三位” “日” “年” “小时:分:秒”
End if
End Function
response.Write FormatDateTimer("2010-07-29 00:00:00",5) '输出时间,模式为5
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<%
dim DateNew,rsDate,DateYear,DateMonth,DateDay,DateHour,DateMinute,DateSecond
rsDate = now()
DateYear = year(rsDate)
DateMonth = Month(rsDate)
if DateMonth = "1" then DateMonth = "Jan"
if DateMonth = "2" then DateMonth = "Feb"
if DateMonth = "3" then DateMonth = "Mar"
if DateMonth = "4" then DateMonth = "Apr"
if DateMonth = "5" then DateMonth = "May"
if DateMonth = "6" then DateMonth = "Jun"
if DateMonth = "7" then DateMonth = "Jul"
if DateMonth = "8" then DateMonth = "Aug"
if DateMonth = "9" then DateMonth = "Sep"
if DateMonth = "10" then DateMonth = "Oct"
if DateMonth = "11" then DateMonth = "Nov"
if DateMonth = "12" then DateMonth = "Dec"
DateDay = Day(rsDate)
DateHour = Hour(rsDate)
DateMinute = Minute(rsDate)
DateSecond = Second(rsDate)
DateNew = DateMonth &" "& DateDay &" "& DateYear &" "& DateHour &":"& DateMinute &":"& DateSecond
Response.Write "常规日期:" & rsDate
Response.Write "<br />"
Response.Write "转化日期:" & DateNew
%>
dim DateNew,rsDate,DateYear,DateMonth,DateDay,DateHour,DateMinute,DateSecond
rsDate = now()
DateYear = year(rsDate)
DateMonth = Month(rsDate)
if DateMonth = "1" then DateMonth = "Jan"
if DateMonth = "2" then DateMonth = "Feb"
if DateMonth = "3" then DateMonth = "Mar"
if DateMonth = "4" then DateMonth = "Apr"
if DateMonth = "5" then DateMonth = "May"
if DateMonth = "6" then DateMonth = "Jun"
if DateMonth = "7" then DateMonth = "Jul"
if DateMonth = "8" then DateMonth = "Aug"
if DateMonth = "9" then DateMonth = "Sep"
if DateMonth = "10" then DateMonth = "Oct"
if DateMonth = "11" then DateMonth = "Nov"
if DateMonth = "12" then DateMonth = "Dec"
DateDay = Day(rsDate)
DateHour = Hour(rsDate)
DateMinute = Minute(rsDate)
DateSecond = Second(rsDate)
DateNew = DateMonth &" "& DateDay &" "& DateYear &" "& DateHour &":"& DateMinute &":"& DateSecond
Response.Write "常规日期:" & rsDate
Response.Write "<br />"
Response.Write "转化日期:" & DateNew
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="UTF-8" />
<%function FormatEnTime(theTime)
dim myArray1,myArray2,years,months,days,timeArray
FormatEnTime=""
timeArray = split(theTime," ")
theTime = timeArray(0)
currenttime = timeArray(1)
myArray1=split(theTime," ")
theTime=myArray1(0)
myArray2=split(theTime,"-")
years=myArray2(0)
months=myArray2(1)
days=myArray2(2)
select case months
case "01"
months="January"
case "02"
months="February"
case "03"
months="March"
case "04"
months="April"
case "05"
months="May"
case "06"
months="June"
case "07"
months="July"
case "08"
months="August"
case "09"
months="September"
case "10"
months="October"
case "11"
months="November"
case else
months="December"
end select
theTime=months&" "&days&" "&years&" "¤ttime
FormatEnTime=theTime '输出的结果
End Function
Response.write FormatEnTime("2010-07-29 00:00:00")
%>
<meta http-equiv="Content-Language" content="UTF-8" />
<%function FormatEnTime(theTime)
dim myArray1,myArray2,years,months,days,timeArray
FormatEnTime=""
timeArray = split(theTime," ")
theTime = timeArray(0)
currenttime = timeArray(1)
myArray1=split(theTime," ")
theTime=myArray1(0)
myArray2=split(theTime,"-")
years=myArray2(0)
months=myArray2(1)
days=myArray2(2)
select case months
case "01"
months="January"
case "02"
months="February"
case "03"
months="March"
case "04"
months="April"
case "05"
months="May"
case "06"
months="June"
case "07"
months="July"
case "08"
months="August"
case "09"
months="September"
case "10"
months="October"
case "11"
months="November"
case else
months="December"
end select
theTime=months&" "&days&" "&years&" "¤ttime
FormatEnTime=theTime '输出的结果
End Function
Response.write FormatEnTime("2010-07-29 00:00:00")
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个有什么用么?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询