Duration calculater
This code takes a value of seconds as an input value and then calculates the duration in seconds, minutes, hours and days without using any VB date function. This code runs super fast. I wrote this for my IRC Server and thought it might be any useful for you... if you like it, you may want to vote, if not, well the not, i guess ;)
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
<p>Public Function Duration(ByVal InSeconds As Long) As String<br> Dim Seconds As Long, mins As Long, Hours As Long, Days As Long<br> Seconds = InSeconds Mod 60<br> mins = (InSeconds \ 60) Mod 60<br> Hours = ((InSeconds \ 60) \ 60) Mod 24<br> Days = ((InSeconds \ 60) \ 60) \ 24<br> Duration = Days & " days " & Format$(Hours, "00") & ":" & Format$(mins, "00") & ":" & Format$(Seconds, "00")<br> End Function</p>
Original Comments (3)
Recovered from Wayback Machine