您的位置:程序门 -> vb -> 基础类



时间比较问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


时间比较问题
发表于:2007-08-10 14:34:12 楼主
用time   来比较     早上9点到晚上20点

如何来实现?


  if   time   >   "#09:00:00# "   and   time   <   "#20:00:00# "   then
 
        msgbox   "ok! "

  end   if


这样写不对,还能如何比较?
发表于:2007-08-10 14:57:161楼 得分:0
dim   dt   as   date
        dt   =   now
        if   hour(dt)   > =   9   and   hour(dt)   <   12   then
                msgbox   "ok "
        end   if
发表于:2007-08-11 11:32:122楼 得分:0
dit   t   as   data
    t   =   now
    if   t   > =8   &   t   <=20     then    
      msgbox "ok "
end   if


快速检索

最新资讯
热门点击