如何用asp编写一个简单的 在网页中显示当前日期、星期以及根据不同时间段的问候语

来源:百度知道 编辑:UC知道 时间:2024/06/04 12:31:12
要程序!!! 急~ 多谢

<%
week=weekday(now)
if week=1 then
week="一"
elseif week=2 then
week="二"
elseif week=3 then
week="三"
elseif week=4 then
week="四"
elseif week=5 then
week="五"
elseif week=6 then
week="六"
elseif week=7 then
week="日"
end if

hours=hour(now)
if hours > 5 and hours < 11 then
hours="早上好!"
elseif hours > 11 and hours < 13 then
hours="中午好!"
elseif hours > 13 and hours < 16 then
hours="下午好!"
elseif hours > 16 and hours < 18 then
hours="傍晚好!"
elseif hours > 18 and hours < 23 then
hours="晚上好!"
elseif hours > 23 or hours < 5 then
hours="深更半夜的 该睡觉了!"
end if
response.write year(now)&"年"&month(now)&"月"&day(now)&"日 星期"&week&" "&hour(now)