2个回答
展开全部
Private Sub Command1_Click()
Dim Num As Long, intDay As Integer, intHour As Integer, intMinute As Integer, intSecond As Integer
Num = Val(Text1.Text)
intDay = Num \ 86400
Debug.Print intDay
intHour = (Num Mod 86400) \ 3600
Debug.Print intHour
intMinute = (Num Mod 86400 Mod 3600) \ 60
Debug.Print intMinute
intSecond = Num Mod 86400 Mod 3600 Mod 60
Debug.Print intSecond
Label2.Caption = CStr(intDay) + "日" + CStr(intHour) + "时" + CStr(intMinute) + "分" + CStr(intSecond) + "秒"
End Sub
2014-05-19
展开全部
添加text,label,command控件,Private Sub Command1_Click()
Dim ri, shi, fen, miao As Integer
miao = Text1.Text Mod 60
fen = (Text1.Text - miao) / 60 Mod 60
shi = (Text1.Text - miao - fen * 60) / 3600 Mod 24
ri = (Text1.Text - miao - fen * 60 - shi * 3600) / 3600 / 24
Label1.Caption = ri & "日" & shi & "时" & fen & "分" & miao & "秒"
End Sub
Dim ri, shi, fen, miao As Integer
miao = Text1.Text Mod 60
fen = (Text1.Text - miao) / 60 Mod 60
shi = (Text1.Text - miao - fen * 60) / 3600 Mod 24
ri = (Text1.Text - miao - fen * 60 - shi * 3600) / 3600 / 24
Label1.Caption = ri & "日" & shi & "时" & fen & "分" & miao & "秒"
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询