home *** CD-ROM | disk | FTP | other *** search
/ 221.214.14.186 / 221.214.14.186.tar / 221.214.14.186 / zb / Notepad-1 / time.asp < prev    next >
Text File  |  2004-12-09  |  1KB  |  56 lines

  1. <%
  2. function times(t)
  3.     if not isdate(t) then exit function
  4.     dim thour, tminute, tday, nowday, dnt, dayshow, pshow
  5.     thour=hour(t)
  6.     tminute=minute(t)
  7.     tday=datevalue(t)
  8.     nowday=datevalue(dateadd("h",timeDiff,now))
  9.     
  10.     if thour<10 then
  11.         thour="0"&thour
  12.     end if
  13.     if tminute<10 then
  14.         tminute="0"&tminute
  15.     end if
  16.     
  17.     dnt=datediff("d",tday,nowday)
  18.     if dnt>2 then
  19.        dayshow=year(t)
  20.        if (month(t)<10) then
  21.            dayshow=dayshow&"-0"&month(t)
  22.        else
  23.            dayshow=dayshow&"-"&month(t)
  24.        end if
  25.        if (day(t)<10) then
  26.            dayshow=dayshow&"-0"&day(t)
  27.        else
  28.            dayshow=dayshow&"-"&day(t)
  29.        end if
  30.        times=dayshow
  31.        exit function
  32.     elseif dnt=0 then
  33.        dayshow="╜±╠∞ "
  34.     elseif dnt=1 then
  35.        dayshow="╫≥╠∞ "
  36.     elseif dnt=2 then
  37.        dayshow="╟░╠∞ "
  38.     end if
  39.     
  40.     'if thour>=7 and thour<11 then
  41.     '   pshow="╔╧╬τ"
  42.     'elseif thour>=11 and thour<14 then
  43.     '   pshow="╓╨╬τ"
  44.     'elseif thour>=14 and thour<18 then
  45.     '  pshow="╧┬╬τ"
  46.     'elseif thour>=18 then
  47.     '   pshow="═φ╔╧"
  48.     'elseif thour>=0 and thour<7 then
  49.     '  pshow="╟σ│┐"
  50.     'else
  51.     '  pshow="─╤╦╡"
  52.     'end if
  53.     
  54.     times=dayshow&pshow&thour&":"&tminute
  55. end function
  56. %>