Private Sub Command1_Click() Command5.Caption = Time If InStr(Format(Command5.Caption, "Medium Time"), "上午") Then MsgBox "上午" Else MsgBox "下午" End If End Sub
Private Sub Command1_Click() Command1.Caption = Time If Val(Format(Command1.Caption, "HH")) < 12 Then MsgBox "上午" Else MsgBox "下午" End If End Sub
Private Sub Command1_Click() dim d as date d=Time Command5.Caption = cstr(d) If hour(d) < 12 Then MsgBox "上午" Else MsgBox "下午" End If End Sub
mokton 这种方法比较好的,支持
MsgBox Left(Format(Time, "Medium Time"), 2)
If Format(Time, "HH") < 12 Then MsgBox "上午" Else MsgBox "下午" End If
Private Sub Command1_Click()
Command5.Caption = Time
If InStr(Format(Command5.Caption, "Medium Time"), "上午") Then
MsgBox "上午"
Else
MsgBox "下午"
End If
End Sub
Command1.Caption = Time
If Val(Format(Command1.Caption, "HH")) < 12 Then
MsgBox "上午"
Else
MsgBox "下午"
End If
End Sub
Private Sub Command1_Click()
dim d as date
d=Time
Command5.Caption = cstr(d) If hour(d) < 12 Then
MsgBox "上午"
Else
MsgBox "下午"
End If
End Sub
MsgBox Left(Format(Time, "Medium Time"), 2)
MsgBox "上午"
Else
MsgBox "下午"
End If