需求:判断当前是否是工作时间
工作事件为:8:30-11:30 和 14:00-5:30
还有判断是否是周末周末的话也不算工作时间。非常感谢!
工作事件为:8:30-11:30 和 14:00-5:30
还有判断是否是周末周末的话也不算工作时间。非常感谢!
解决方案 »
- 送分100分:load 窗体 会自动执行该哪几个过程
- 很浅的问题
- 关于vb设置windwos系统服务问题
- msflexgrid表格,显示内容时,想根据字段的不同值确定某一条的颜色,如何实现呀?
- 请高手帮俺看看,送分了!
- 请教数据源和记录集的区别与联系
- ”在线播放不下载“,在线播放了后,C:\WIN98\Temporary Internet Files目录下怎么没有
- FileSystemObject对象的突发事件,各位请帮忙拉!!!
- VB与SQL2000
- **********y1g1y1(袁飞☆曾经沧海难为水,除却VB不是云☆)******袁兄!小弟还没说完呢?
- dao350.dll 无法注册系统数据库??????
- 如何用vb6.0做一個系統自動鄧錄﹐那一部分的源代碼怎么寫﹐謝謝﹗﹗
datenow = now()
if #8:30# <= datenow and datenow <=#11:30# or _
#14:00# <= datenow and datenow <=#17:30# then
msgbox "是工作时间"
else
msgbox "不是工作时间哦"
endif
MsgBox "休息日"
End If If (Format(Now, "hh:ss") > Format("8:30", "hh:ss")) And (Format(Now, "hh:ss") < Format("11:30", "hh:ss")) Then
MsgBox "工作时间"
Else
End If
If (Format(Now, "hh:ss") > Format("14:00", "hh:ss")) And (Format(Now, "hh:ss") < Format("17:30", "hh:ss")) Then
MsgBox "工作时间"
Else
MsgBox "不是工作时间"
End IfEnd Sub
MsgBox "不是工作时间哦"
ElseIf #8:30:00 AM# <= Time And Time <= #11:30:00 AM# Or # _
2:00:00 PM# <= Time And Time <= #5:30:00 PM# Then
MsgBox "是工作时间"
Else
MsgBox "不是工作时间哦"
End If
Private Sub Command1_Click() If DatePart("w", Now) = vbSaturday Or DatePart("w", Now) = vbSunday Then
MsgBox "休息日"
Exit Sub
End If If (Format(Now, "hh:ss") > Format("8:30", "hh:ss")) And (Format(Now, "hh:ss") < Format("11:30", "hh:ss")) Then
MsgBox "工作时间"
Else
MsgBox "不是工作时间"
End If
If (Format(Now, "hh:ss") > Format("14:00", "hh:ss")) And (Format(Now, "hh:ss") < Format("17:30", "hh:ss")) Then
MsgBox "工作时间"
Else
MsgBox "不是工作时间"
End IfEnd Sub
Dim t
If Weekday(Date, vbMonday) < 6 Then
t = Tiem
IsWorkTime = (t >= Cdate("8:30") And t <= Cdate("11:30")) Or _
(t >= Cdate("14:00") And t <= Cdate("17:00"))
End If
End Function