- Joined
- Jul 16, 2012
- Messages
- 679
Hello fellas!
I want to know how to get a Hour, Minutes, and Seconds
stackoverflow.com's Source Code
So the problem is, I don't know how to get the hour
I want to know how to get a Hour, Minutes, and Seconds
Code:
Dim lSeconds, lMinutes As Long
Dim sTimeDiff As String
lSeconds = DateDiff("s", TimeStart, TimeEnd)
lMinutes = Fix(lSeconds / 60) '// Gets the whole number (not rounded)
lSeconds = ((lSeconds / 60) - lMinutes) * 60 '// get the remaining seconds
sTimeDiff = "00:" & Format$(lMinutes, "00") & ":" & Format$(lSeconds, "00")
So the problem is, I don't know how to get the hour