Source code berikut untuk mengonversi detik ke jam menit detik. Misalkan jika input 3660 detik, maka output yang dihasilkan adalah 1 Jam 1 Menit 0 Detik.
Buat 1 project dengan :
1 Form
1 TextBox
1 CommandButton
Copy source code berikut pada Form :
01 | Private Sub Command1_Click() |
02 | Dim hour, minute, second As Long |
03 | Dim a, b, c, d As Long |
07 | minute = Int((a - b) / 60) |
08 | second = a - b - (minute * 60) |
09 | MsgBox "Hasil konversi = " & hour & " jam " & minute & " menit " & second & " detik " , vbOKOnly |
—
No comments:
Post a Comment