'============================================================ 'SecondTime 0時0分0秒を基準に、それからの経過時間を秒で返す '------引数-------------------------------------------------- 'h,m,s それぞれ時,分,秒 '============================================================ Public Function SecondTime(h As Long, m As Long, s As Long) _ As Long SecondTime = h * 3600 + m * 60 + s End Function |
'============================================================ 'GetTimer 時間ss(秒)から時間ms(秒)までの時間を、 ' h時間m分s秒の形で返す。(時間差の計算) '------引数-------------------------------------------------- 'ss,ms 時間差を計算したい時間(ss<ms) 'h,m,s 時間差、それぞれ時,分,秒を格納する '============================================================ Public Sub GetTimer(ss As Long, ms As Long, h As Long, _ m As Long, s As Long) h = (ms - ss) \ 3600& m = (ms - ss - h * 3600&) \ 60& s = (ms - ss - h * 3600&) Mod 60& End Sub |
Dim ct As New CGetTime Dim h As Long, m As Long, s As Long Dim sec As Long 'ある時刻を秒に換算 sec = ct.SecondTime(ある時間, 分, 秒) '0時0分0秒からの時間差を求める=求めたい時刻 Call ct.GetTimer(0, sec + ?秒後, h, m, s) Label1.Caption = h & "時" & m & "分" & s & "秒です" |
機種 | PC-9821V13S |
OS | Windows95 |
開発ツール | Visual Basic Ver.4.0 |
更新日 | 00/2/2 |