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
展开
 我来答
Keboywaking
2010-07-08 · TA获得超过461个赞
知道小有建树答主
回答量:73
采纳率:0%
帮助的人:94.6万
展开全部
<%
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
%>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
chengjitao
2010-07-08 · 超过33用户采纳过TA的回答
知道答主
回答量:248
采纳率:0%
帮助的人:118万
展开全部
<%
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
%>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
理工爱好者

2010-07-07 · TA获得超过2283个赞
知道大有可为答主
回答量:5249
采纳率:97%
帮助的人:637万
展开全部
需要写函数自己处理
asp没有专门的格式化方式

参考:http://www.baidu.com/s?wd=asp+%B8%F1%CA%BD%BB%AF%C8%D5%C6%DA
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
路瓃pv
2010-07-08 · TA获得超过961个赞
知道小有建树答主
回答量:653
采纳率:0%
帮助的人:546万
展开全部
<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")
%>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
wuxin8882004
2010-07-08 · TA获得超过313个赞
知道小有建树答主
回答量:1074
采纳率:0%
帮助的人:328万
展开全部
这个有什么用么?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(3)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式